<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <link rel="canonical" href="https://blog.csdn.net/weixin_41084236/article/details/81564963"/>
    <meta http-equiv="content-type" content="text/html; charset=utf-8">
    <meta name="renderer" content="webkit"/>
    <meta name="force-rendering" content="webkit"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="report" content='{"pid":"blog"}'>
    <meta name="referrer" content="always">
    <meta http-equiv="Cache-Control" content="no-siteapp" /><link rel="alternate" media="handheld" href="#" />
    <meta name="shenma-site-verification" content="5a59773ab8077d4a62bf469ab966a63b_1497598848">
        <meta name="csdn-baidu-search"  content='{"autorun":true,"install":true,"keyword":"快速入门（完整）：Python实例100个（基于最新Python3.7版本） - Shawn的博客"}'>
    
    <link href="https://csdnimg.cn/public/favicon.ico" rel="SHORTCUT ICON">
    <title>快速入门（完整）：Python实例100个（基于最新Python3.7版本） - Shawn的博客 - CSDN博客</title>
    <meta name="description" content="Python3100例原题地址：http://www.runoob.com/python/python-100-examples.htmlgit地址：https://github.com/RichardFu123/Python100Cases原例为Python2.7版本重写过程中有不少是随意发挥的重写运行版本：Python3.7总...">

        
                    <link rel="stylesheet" href="https://csdnimg.cn/release/phoenix/template/css/detail-52bde8d329.min.css">
                    
            <link rel="stylesheet" href="https://csdnimg.cn/release/phoenix/themes/skin3-template/skin3-template-c9d2f651cc.min.css">
    
<!--    自定义皮肤样式-->
    
    <script type="text/javascript">
        var username = "weixin_41084236";
        var blog_address = "https://blog.csdn.net/weixin_41084236";
        var static_host = "https://csdnimg.cn/release/phoenix/";
        var currentUserName = "";
        var isShowAds = true;
        var isOwner = false;
        var loginUrl = "http://passport.csdn.net/account/login?from=https://blog.csdn.net/weixin_41084236/article/details/81564963"
        var blogUrl = "https://blog.csdn.net/";

        var curSkin = "skin3-template";
        // 收藏所需数据
        var articleTitle = "快速入门（完整）：Python实例100个（基于最新Python3.7版本）";
        var articleDesc = "Python3100例原题地址：http://www.runoob.com/python/python-100-examples.htmlgit地址：https://github.com/RichardFu123/Python100Cases原例为Python2.7版本重写过程中有不少是随意发挥的重写运行版本：Python3.7总...";
        // 第四范式所需数据
        var articleTitles = "快速入门（完整）：Python实例100个（基于最新Python3.7版本） - Shawn的博客";
        
        var nickName = "超级大黄狗Shawn";
        var isCorporate = false;
        var subDomainBlogUrl = "https://blog.csdn.net/"
        var digg_base_url = "https://blog.csdn.net/weixin_41084236/phoenix/comment";
        var articleDetailUrl = "https://blog.csdn.net/weixin_41084236/article/details/81564963";
        var isShowThird = "0"
    </script>
    <script src="https://csdnimg.cn/public/common/libs/jquery/jquery-1.9.1.min.js" type="text/javascript"></script>
    <!--js引用-->
            <script src="//g.csdnimg.cn/??fixed-sidebar/1.1.6/fixed-sidebar.js,lib/fingerprintjs2/2.1.0/fingerprint2.min.js,report/1.1.1/report.js" type="text/javascript"></script>
    <link rel="stylesheet" href="https://csdnimg.cn/public/sandalstrap/1.4/css/sandalstrap.min.css">
    <style>
        .MathJax, .MathJax_Message, .MathJax_Preview{
            display: none
        }
    </style>
</head>
<body class="nodata " > 
    <link rel="stylesheet" href="https://csdnimg.cn/public/common/toolbar/content_toolbar_css/content_toolbar.css">
    <script id="toolbar-tpl-scriptId" src="https://csdnimg.cn/public/common/toolbar/js/content_toolbar.js" type="text/javascript" domain="https://blog.csdn.net/"></script>
    <script>
    (function(){
        var bp = document.createElement('script');
        var curProtocol = window.location.protocol.split(':')[0];
        if (curProtocol === 'https') {
            bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';
        }
        else {
            bp.src = 'http://push.zhanzhang.baidu.com/push.js';
        }
        var s = document.getElementsByTagName("script")[0];
        s.parentNode.insertBefore(bp, s);
    })();
</script>
<div id="kp_box_476" data-pid="476"><script src="//csdnimg.cn/public/common/indexSuperise/1.1.1/indexSuperise.js?20190111165312"></script><script>window.csdn.indexSuperise({smallMoveImg:'https://img-bss.csdn.net/1563176736560.png',bigMoveImg:'https://img-bss.csdn.net/1563176731384.png',link:'https://kunyu.csdn.net?d=2&m=ncpQQHcDmAtnHEcpAtSSpQbpJmttLSALyitHbfJLypbbbSXiLbLApLEEtHtpLDLSXvnSppHQtWQnAUypnSXSttQvoJbmtHiiJcQQ&k=&dest=https%3A%2F%2Fedu.csdn.net%2Ftopic%2Fai30%3Futm_source%3Dblogpopup4&timestamp=1573805046432&signature=4617d3fc064fc7fa65c511e45dcf1e6aaab60feb',trackSuperId:476,smallMove:'notMove',trackSId:1087});</script><img class="pre-img-lasy" data-src='https://kunyu.csdn.net/1.png?d=2&k=&m=ncpQQHcDmAtnHEcpAtSSpQbpJmttLSALyitHbfJLypbbbSXiLbLApLEEtHtpLDLSXvnSppHQtWQnAUypnSXSttQvoJbmtHiiJcQQ'></div><link rel="stylesheet" href="https://csdnimg.cn/release/phoenix/template/css/blog_code-c3a0c33d5c.css">
<link rel="stylesheet" href="https://csdnimg.cn/release/phoenix/vendor/pagination/paging-e040f0c7c8.css">

<script type="text/javascript">
	var NEWS_FEED = function(){}
</script>

<link rel="stylesheet" href="https://csdnimg.cn/release/phoenix/template/css/chart-3456820cac.css" />
<div class="main_father clearfix d-flex justify-content-center" style="height:100%;"> 
    <div class="container clearfix" id="mainBox">
        <div  class='space_container'></div>
        <main>
            <div class="blog-content-box">
    <div class="article-header-box">
        <div class="article-header">
            <div class="article-title-box">
                <span class="article-type type-1 float-left">原创</span>                <h1 class="title-article">快速入门（完整）：Python实例100个（基于最新Python3.7版本）</h1>
            </div>
            <div class="article-info-box">
                <div class="article-bar-top">
                                            <span class="c-gray">置顶</span>
                                                                                                                                                                <span class="time">2018-08-10 16:01:27</span>
                    <a class="follow-nickName" href="https://me.csdn.net/weixin_41084236" target="_blank" rel="noopener">超级大黄狗Shawn</a>
                    <span class="read-count">阅读数 82033</span>
                                                        </div>
                <div class="operating">
                                    </div>
            </div>
        </div>
    </div>
    <article class="baidu_pl">
                 <div id="article_content" class="article_content clearfix">
                                                <div class="article-copyright">
                <span class="creativecommons">
                <a rel="license" href="http://creativecommons.org/licenses/by-sa/4.0/">
                    </a>
            <span>
                版权声明：本文为博主原创文章，遵循<a href="http://creativecommons.org/licenses/by-sa/4.0/" target="_blank" rel="noopener"> CC 4.0 BY-SA </a>版权协议，转载请附上原文出处链接和本声明。            </span>
               <div class="article-source-link2222">
                    本文链接：<a href="https://blog.csdn.net/weixin_41084236/article/details/81564963">https://blog.csdn.net/weixin_41084236/article/details/81564963</a>
                </div>
            </span>
                    </div>
                                                    <!--一个博主专栏付费入口-->
             
             <!--一个博主专栏付费入口结束-->
            <link rel="stylesheet" href="https://csdnimg.cn/release/phoenix/template/css/ck_htmledit_views-4a3473df85.css" />
                                        <div id="content_views" class="markdown_views prism-atom-one-dark">
                    <!-- flowchart 箭头图标 勿删 -->
                    <svg xmlns="http://www.w3.org/2000/svg" style="display: none;">
                        <path stroke-linecap="round" d="M5,0 0,2.5 5,5z" id="raphael-marker-block" style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);"></path>
                    </svg>
                                            <h1><a id="Python3_100_0"></a>Python3 100例</h1>
<blockquote>
<p>原题地址：<br>
<a href="http://www.runoob.com/python/python-100-examples.html" rel="nofollow">http://www.runoob.com/python/python-100-examples.html</a><br>
git地址：<br>
<a href="https://github.com/RichardFu123/Python100Cases" rel="nofollow">https://github.com/RichardFu123/Python100Cases</a><br>
转载请标注：<br>
<a href="https://blog.csdn.net/weixin_41084236/article/details/81564963" rel="nofollow">https://blog.csdn.net/weixin_41084236/article/details/81564963</a><br>
原例为Python2.7版本<br>
重写过程中有不少是随意发挥的<br>
重写运行版本：Python3.7<br>
作者:Shawn</p>
</blockquote>
<ul>
<li>总的来说，并没有什么难度，全部搂了一遍也只花了不到2天时间，其中还有一半以上的时间是用来写文档的。</li>
<li>用来练练手还是凑合的。</li>
</ul>
<p></p><div class="toc"><h3>文章目录</h3><ul><li><a href="#Python3_100_0" rel="nofollow">Python3 100例</a></li><ul><ul><ul><li><a href="#001_18" rel="nofollow">实例001：数字组合</a></li><li><a href="#002_46" rel="nofollow">实例002：“个税计算”</a></li><li><a href="#003_68" rel="nofollow">实例003：完全平方数</a></li><li><a href="#004_98" rel="nofollow">实例004：这天第几天</a></li><li><a href="#005_120" rel="nofollow">实例005：三数排序</a></li><li><a href="#006_147" rel="nofollow">实例006：斐波那契数列</a></li><li><a href="#007copy_169" rel="nofollow">实例007：copy</a></li><li><a href="#008_201" rel="nofollow">实例008：九九乘法表</a></li><li><a href="#009_214" rel="nofollow">实例009：暂停一秒输出</a></li><li><a href="#010_227" rel="nofollow">实例010：给人看的时间</a></li><li><a href="#011_241" rel="nofollow">实例011：养兔子</a></li><li><a href="#012100200_262" rel="nofollow">实例012：100到200的素数</a></li><li><a href="#013_292" rel="nofollow">实例013：所有水仙花数</a></li><li><a href="#014_308" rel="nofollow">实例014：分解质因数</a></li><li><a href="#015_343" rel="nofollow">实例015：分数归档</a></li><li><a href="#016_360" rel="nofollow">实例016：输出日期</a></li><li><a href="#017_376" rel="nofollow">实例017：字符串构成</a></li><li><a href="#018_404" rel="nofollow">实例018：复读机相加</a></li><li><a href="#019_420" rel="nofollow">实例019：完数</a></li><li><a href="#020_441" rel="nofollow">实例020：高空抛物</a></li><li><a href="#021_457" rel="nofollow">实例021：猴子偷桃</a></li><li><a href="#022_470" rel="nofollow">实例022：比赛对手</a></li><li><a href="#023_489" rel="nofollow">实例023：画菱形</a></li><li><a href="#024II_513" rel="nofollow">实例024：斐波那契数列II</a></li><li><a href="#025__530" rel="nofollow">实例025： 阶乘求和</a></li><li><a href="#026_543" rel="nofollow">实例026：递归求阶乘</a></li><li><a href="#027_555" rel="nofollow">实例027：递归输出</a></li><li><a href="#028_570" rel="nofollow">实例028：递归求等差数列</a></li><li><a href="#029_584" rel="nofollow">实例029：反向输出</a></li><li><a href="#030_597" rel="nofollow">实例030：回文数</a></li><li><a href="#031_618" rel="nofollow">实例031：字母识词</a></li><li><a href="#032II_642" rel="nofollow">实例032：反向输出II</a></li><li><a href="#033_653" rel="nofollow">实例033：列表转字符串</a></li><li><a href="#034_664" rel="nofollow">实例034：调用函数</a></li><li><a href="#035_681" rel="nofollow">实例035：设置输出颜色</a></li><li><a href="#036_700" rel="nofollow">实例036：算素数</a></li><li><a href="#037_718" rel="nofollow">实例037：排序</a></li><li><a href="#038_738" rel="nofollow">实例038：矩阵对角线之和</a></li><li><a href="#039_755" rel="nofollow">实例039：有序列表插入元素</a></li><li><a href="#040_773" rel="nofollow">实例040：逆序列表</a></li><li><a href="#041_794" rel="nofollow">实例041：类的方法与变量</a></li><li><a href="#042_818" rel="nofollow">实例042：变量作用域</a></li><li><a href="#043_847" rel="nofollow">实例043：作用域、类的方法与变量</a></li><li><a href="#044_868" rel="nofollow">实例044：矩阵相加</a></li><li><a href="#045_893" rel="nofollow">实例045：求和</a></li><li><a href="#046_906" rel="nofollow">实例046：打破循环</a></li><li><a href="#047_926" rel="nofollow">实例047：函数交换变量</a></li><li><a href="#048_941" rel="nofollow">实例048：数字比大小</a></li><li><a href="#049lambda_958" rel="nofollow">实例049：lambda</a></li><li><a href="#050_975" rel="nofollow">实例050：随机数</a></li><li><a href="#051_986" rel="nofollow">实例051：按位与</a></li><li><a href="#052_1001" rel="nofollow">实例052：按位或</a></li><li><a href="#053_1013" rel="nofollow">实例053：按位异或</a></li><li><a href="#054_1025" rel="nofollow">实例054：位取反、位移动</a></li><li><a href="#055_1048" rel="nofollow">实例055：按位取反</a></li><li><a href="#056_1059" rel="nofollow">实例056：画圈</a></li><li><a href="#057_1078" rel="nofollow">实例057：画线</a></li><li><a href="#058_1113" rel="nofollow">实例058：画矩形</a></li><li><a href="#059_1140" rel="nofollow">实例059：画图（丑）</a></li><li><a href="#060_1180" rel="nofollow">实例060：字符串长度</a></li><li><a href="#061_1191" rel="nofollow">实例061：杨辉三角</a></li><li><a href="#062_1208" rel="nofollow">实例062：查找字符串</a></li><li><a href="#063_1222" rel="nofollow">实例063：画椭圆</a></li><li><a href="#064_1245" rel="nofollow">实例064：画椭圆、矩形</a></li><li><a href="#065_1271" rel="nofollow">实例065：画组合图形</a></li><li><a href="#066_1320" rel="nofollow">实例066：三数排序</a></li><li><a href="#067_1347" rel="nofollow">实例067：交换位置</a></li><li><a href="#068_1366" rel="nofollow">实例068：旋转数列</a></li><li><a href="#069_1381" rel="nofollow">实例069：报数</a></li><li><a href="#070II_1414" rel="nofollow">实例070：字符串长度II</a></li><li><a href="#071_1427" rel="nofollow">实例071：输入和输出</a></li><li><a href="#072_1462" rel="nofollow">实例072：创建链表</a></li><li><a href="#073_1558" rel="nofollow">实例073：反向输出链表</a></li><li><a href="#074_1655" rel="nofollow">实例074：列表排序、连接</a></li><li><a href="#075_1669" rel="nofollow">实例075：不知所云</a></li><li><a href="#076_1686" rel="nofollow">实例076：做函数</a></li><li><a href="#077_1719" rel="nofollow">实例077：遍历列表</a></li><li><a href="#078_1731" rel="nofollow">实例078：字典</a></li><li><a href="#079_1748" rel="nofollow">实例079：字符串排序</a></li><li><a href="#080_1760" rel="nofollow">实例080：猴子分桃</a></li><li><a href="#081_1787" rel="nofollow">实例081：求未知数</a></li><li><a href="#082_1810" rel="nofollow">实例082：八进制转十进制</a></li><li><a href="#083_1821" rel="nofollow">实例083：制作奇数</a></li><li><a href="#084_1849" rel="nofollow">实例084：连接字符串</a></li><li><a href="#085_1861" rel="nofollow">实例085：整除</a></li><li><a href="#086II_1886" rel="nofollow">实例086：连接字符串II</a></li><li><a href="#087_1898" rel="nofollow">实例087：访问类成员</a></li><li><a href="#088_1919" rel="nofollow">实例088：打印星号</a></li><li><a href="#089_1930" rel="nofollow">实例089：解码</a></li><li><a href="#090_1948" rel="nofollow">实例090：列表详解</a></li><li><a href="#091time_1985" rel="nofollow">实例091：time模块</a></li><li><a href="#092timeII_1999" rel="nofollow">实例092：time模块II</a></li><li><a href="#093timeIII_2016" rel="nofollow">实例093：time模块III</a></li><li><a href="#094timeIV_2032" rel="nofollow">实例094：time模块IV</a></li><li><a href="#095_2074" rel="nofollow">实例095：转换时间格式</a></li><li><a href="#096_2086" rel="nofollow">实例096：计算复读次数</a></li><li><a href="#097_2098" rel="nofollow">实例097：磁盘写入</a></li><li><a href="#098II_2117" rel="nofollow">实例098：磁盘写入II</a></li><li><a href="#099_2134" rel="nofollow">实例099：磁盘读写</a></li><li><a href="#100_2160" rel="nofollow">实例100：列表转字典</a></li></ul></ul></ul></ul></div><p></p>
<h4><a id="001_18"></a>实例001：数字组合</h4>
<p><strong>题目</strong> 有四个数字：1、2、3、4，能组成多少个互不相同且无重复数字的三位数？各是多少？</p>
<p><strong>程序分析</strong> 遍历全部可能，把有重复的剃掉。</p>
<pre><code class="prism language-python">total<span class="token operator">=</span><span class="token number">0</span>
<span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token number">1</span><span class="token punctuation">,</span><span class="token number">5</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
    <span class="token keyword">for</span> j <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token number">1</span><span class="token punctuation">,</span><span class="token number">5</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
        <span class="token keyword">for</span> k <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token number">1</span><span class="token punctuation">,</span><span class="token number">5</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
            <span class="token keyword">if</span> <span class="token punctuation">(</span><span class="token punctuation">(</span>i<span class="token operator">!=</span>j<span class="token punctuation">)</span><span class="token operator">and</span><span class="token punctuation">(</span>j<span class="token operator">!=</span>k<span class="token punctuation">)</span><span class="token operator">and</span><span class="token punctuation">(</span>k<span class="token operator">!=</span>i<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
                <span class="token keyword">print</span><span class="token punctuation">(</span>i<span class="token punctuation">,</span>j<span class="token punctuation">,</span>k<span class="token punctuation">)</span>
                total<span class="token operator">+=</span><span class="token number">1</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>total<span class="token punctuation">)</span>
</code></pre>
<p><strong>简便方法</strong> 用itertools中的permutations即可。</p>
<pre><code class="prism language-python"><span class="token keyword">import</span> itertools
sum2<span class="token operator">=</span><span class="token number">0</span>
a<span class="token operator">=</span><span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">,</span><span class="token number">2</span><span class="token punctuation">,</span><span class="token number">3</span><span class="token punctuation">,</span><span class="token number">4</span><span class="token punctuation">]</span>
<span class="token keyword">for</span> i <span class="token keyword">in</span> itertools<span class="token punctuation">.</span>permutations<span class="token punctuation">(</span>a<span class="token punctuation">,</span><span class="token number">3</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span>i<span class="token punctuation">)</span>
    sum2<span class="token operator">+=</span><span class="token number">1</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>sum2<span class="token punctuation">)</span>

</code></pre>
<h4><a id="002_46"></a>实例002：“个税计算”</h4>
<p><strong>题目</strong> 企业发放的奖金根据利润提成。利润(I)低于或等于10万元时，奖金可提10%；利润高于10万元，低于20万元时，低于10万元的部分按10%提成，高于10万元的部分，可提成7.5%；20万到40万之间时，高于20万元的部分，可提成5%；40万到60万之间时高于40万元的部分，可提成3%；60万到100万之间时，高于60万元的部分，可提成1.5%，高于100万元时，超过100万元的部分按1%提成，从键盘输入当月利润I，求应发放奖金总数？</p>
<p><strong>程序分析</strong> 分区间计算即可。</p>
<pre><code class="prism language-python">profit<span class="token operator">=</span><span class="token builtin">int</span><span class="token punctuation">(</span><span class="token builtin">input</span><span class="token punctuation">(</span><span class="token string">'Show me the money: '</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
bonus<span class="token operator">=</span><span class="token number">0</span>
thresholds<span class="token operator">=</span><span class="token punctuation">[</span><span class="token number">100000</span><span class="token punctuation">,</span><span class="token number">100000</span><span class="token punctuation">,</span><span class="token number">200000</span><span class="token punctuation">,</span><span class="token number">200000</span><span class="token punctuation">,</span><span class="token number">400000</span><span class="token punctuation">]</span>
rates<span class="token operator">=</span><span class="token punctuation">[</span><span class="token number">0.1</span><span class="token punctuation">,</span><span class="token number">0.075</span><span class="token punctuation">,</span><span class="token number">0.05</span><span class="token punctuation">,</span><span class="token number">0.03</span><span class="token punctuation">,</span><span class="token number">0.015</span><span class="token punctuation">,</span><span class="token number">0.01</span><span class="token punctuation">]</span>
<span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token builtin">len</span><span class="token punctuation">(</span>thresholds<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
    <span class="token keyword">if</span> profit<span class="token operator">&lt;=</span>thresholds<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">:</span>
        bonus<span class="token operator">+=</span>profit<span class="token operator">*</span>rates<span class="token punctuation">[</span>i<span class="token punctuation">]</span>
        profit<span class="token operator">=</span><span class="token number">0</span>
        <span class="token keyword">break</span>
    <span class="token keyword">else</span><span class="token punctuation">:</span>
        bonus<span class="token operator">+=</span>thresholds<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token operator">*</span>rates<span class="token punctuation">[</span>i<span class="token punctuation">]</span>
        profit<span class="token operator">-=</span>thresholds<span class="token punctuation">[</span>i<span class="token punctuation">]</span>
bonus<span class="token operator">+=</span>profit<span class="token operator">*</span>rates<span class="token punctuation">[</span><span class="token operator">-</span><span class="token number">1</span><span class="token punctuation">]</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>bonus<span class="token punctuation">)</span>
</code></pre>
<h4><a id="003_68"></a>实例003：完全平方数</h4>
<p><strong>题目</strong> 一个整数，它加上100后是一个完全平方数，再加上168又是一个完全平方数，请问该数是多少？</p>
<p><strong>程序分析</strong> 因为168对于指数爆炸来说实在太小了，所以可以直接省略数学分析，用最朴素的方法来获取上限:</p>
<pre><code class="prism language-python">n<span class="token operator">=</span><span class="token number">0</span>
<span class="token keyword">while</span> <span class="token punctuation">(</span>n<span class="token operator">+</span><span class="token number">1</span><span class="token punctuation">)</span><span class="token operator">**</span><span class="token number">2</span><span class="token operator">-</span>n<span class="token operator">*</span>n<span class="token operator">&lt;=</span><span class="token number">168</span><span class="token punctuation">:</span>
    n<span class="token operator">+=</span><span class="token number">1</span>

<span class="token keyword">print</span><span class="token punctuation">(</span>n<span class="token operator">+</span><span class="token number">1</span><span class="token punctuation">)</span>
<span class="token operator">-</span><span class="token operator">-</span><span class="token operator">-</span><span class="token operator">-</span><span class="token operator">-</span><span class="token operator">-</span><span class="token operator">-</span><span class="token operator">-</span><span class="token operator">-</span><span class="token operator">-</span>

<span class="token number">85</span>

</code></pre>
<p>思路是：最坏的结果是n的平方与(n+1)的平方刚好差168，由于是平方的关系，不可能存在比这更大的间隙。<br>
至于判断是否是完全平方数，最简单的方法是：平方根的值小数为0即可。<br>
结合起来：</p>
<pre><code class="prism language-python">n<span class="token operator">=</span><span class="token number">0</span>
<span class="token keyword">while</span> <span class="token punctuation">(</span>n<span class="token operator">+</span><span class="token number">1</span><span class="token punctuation">)</span><span class="token operator">**</span><span class="token number">2</span><span class="token operator">-</span>n<span class="token operator">*</span>n<span class="token operator">&lt;=</span><span class="token number">168</span><span class="token punctuation">:</span>
    n<span class="token operator">+=</span><span class="token number">1</span>

<span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token punctuation">(</span>n<span class="token operator">+</span><span class="token number">1</span><span class="token punctuation">)</span><span class="token operator">**</span><span class="token number">2</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
    <span class="token keyword">if</span> i<span class="token operator">**</span><span class="token number">0.5</span><span class="token operator">==</span><span class="token builtin">int</span><span class="token punctuation">(</span>i<span class="token operator">**</span><span class="token number">0.5</span><span class="token punctuation">)</span> <span class="token operator">and</span> <span class="token punctuation">(</span>i<span class="token operator">+</span><span class="token number">168</span><span class="token punctuation">)</span><span class="token operator">**</span><span class="token number">0.5</span><span class="token operator">==</span><span class="token builtin">int</span><span class="token punctuation">(</span><span class="token punctuation">(</span>i<span class="token operator">+</span><span class="token number">168</span><span class="token punctuation">)</span><span class="token operator">**</span><span class="token number">0.5</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
        <span class="token keyword">print</span><span class="token punctuation">(</span>i<span class="token operator">-</span><span class="token number">100</span><span class="token punctuation">)</span>
</code></pre>
<h4><a id="004_98"></a>实例004：这天第几天</h4>
<p><strong>题目</strong> 输入某年某月某日，判断这一天是这一年的第几天？</p>
<p><strong>程序分析</strong> 特殊情况，闰年时需考虑二月多加一天：</p>
<pre><code class="prism language-python"><span class="token keyword">def</span> <span class="token function">isLeapYear</span><span class="token punctuation">(</span>y<span class="token punctuation">)</span><span class="token punctuation">:</span>
    <span class="token keyword">return</span> <span class="token punctuation">(</span>y<span class="token operator">%</span><span class="token number">400</span><span class="token operator">==</span><span class="token number">0</span> <span class="token operator">or</span> <span class="token punctuation">(</span>y<span class="token operator">%</span><span class="token number">4</span><span class="token operator">==</span><span class="token number">0</span> <span class="token operator">and</span> y<span class="token operator">%</span><span class="token number">100</span><span class="token operator">!=</span><span class="token number">0</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
DofM<span class="token operator">=</span><span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">31</span><span class="token punctuation">,</span><span class="token number">28</span><span class="token punctuation">,</span><span class="token number">31</span><span class="token punctuation">,</span><span class="token number">30</span><span class="token punctuation">,</span><span class="token number">31</span><span class="token punctuation">,</span><span class="token number">30</span><span class="token punctuation">,</span><span class="token number">31</span><span class="token punctuation">,</span><span class="token number">31</span><span class="token punctuation">,</span><span class="token number">30</span><span class="token punctuation">,</span><span class="token number">31</span><span class="token punctuation">,</span><span class="token number">30</span><span class="token punctuation">]</span>
res<span class="token operator">=</span><span class="token number">0</span>
year<span class="token operator">=</span><span class="token builtin">int</span><span class="token punctuation">(</span><span class="token builtin">input</span><span class="token punctuation">(</span><span class="token string">'Year:'</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
month<span class="token operator">=</span><span class="token builtin">int</span><span class="token punctuation">(</span><span class="token builtin">input</span><span class="token punctuation">(</span><span class="token string">'Month:'</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
day<span class="token operator">=</span><span class="token builtin">int</span><span class="token punctuation">(</span><span class="token builtin">input</span><span class="token punctuation">(</span><span class="token string">'day:'</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
<span class="token keyword">if</span> isLeapYear<span class="token punctuation">(</span>year<span class="token punctuation">)</span><span class="token punctuation">:</span>
    DofM<span class="token punctuation">[</span><span class="token number">2</span><span class="token punctuation">]</span><span class="token operator">+=</span><span class="token number">1</span>
<span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span>month<span class="token punctuation">)</span><span class="token punctuation">:</span>
    res<span class="token operator">+=</span>DofM<span class="token punctuation">[</span>i<span class="token punctuation">]</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>res<span class="token operator">+</span>day<span class="token punctuation">)</span>

</code></pre>
<h4><a id="005_120"></a>实例005：三数排序</h4>
<p><strong>题目</strong> 输入三个整数x,y,z，请把这三个数由小到大输出。</p>
<p><strong>程序分析</strong> 练练手就随便找个排序算法实现一下，偷懒就直接调函数。</p>
<pre><code class="prism language-python">raw<span class="token operator">=</span><span class="token punctuation">[</span><span class="token punctuation">]</span>
<span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token number">3</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
    x<span class="token operator">=</span><span class="token builtin">int</span><span class="token punctuation">(</span><span class="token builtin">input</span><span class="token punctuation">(</span><span class="token string">'int%d: '</span><span class="token operator">%</span><span class="token punctuation">(</span>i<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
    raw<span class="token punctuation">.</span>append<span class="token punctuation">(</span>x<span class="token punctuation">)</span>
    
<span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token builtin">len</span><span class="token punctuation">(</span>raw<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
    <span class="token keyword">for</span> j <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span>i<span class="token punctuation">,</span><span class="token builtin">len</span><span class="token punctuation">(</span>raw<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
        <span class="token keyword">if</span> raw<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token operator">&gt;</span>raw<span class="token punctuation">[</span>j<span class="token punctuation">]</span><span class="token punctuation">:</span>
            raw<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">,</span>raw<span class="token punctuation">[</span>j<span class="token punctuation">]</span><span class="token operator">=</span>raw<span class="token punctuation">[</span>j<span class="token punctuation">]</span><span class="token punctuation">,</span>raw<span class="token punctuation">[</span>i<span class="token punctuation">]</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>raw<span class="token punctuation">)</span>


raw2<span class="token operator">=</span><span class="token punctuation">[</span><span class="token punctuation">]</span>
<span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token number">3</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
    x<span class="token operator">=</span><span class="token builtin">int</span><span class="token punctuation">(</span><span class="token builtin">input</span><span class="token punctuation">(</span><span class="token string">'int%d: '</span><span class="token operator">%</span><span class="token punctuation">(</span>i<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
    raw2<span class="token punctuation">.</span>append<span class="token punctuation">(</span>x<span class="token punctuation">)</span>
<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token builtin">sorted</span><span class="token punctuation">(</span>raw2<span class="token punctuation">)</span><span class="token punctuation">)</span>

</code></pre>
<h4><a id="006_147"></a>实例006：斐波那契数列</h4>
<p><strong>题目</strong> 斐波那契数列。</p>
<p><strong>程序分析</strong> 斐波那契数列（Fibonacci sequence），从1,1开始，后面每一项等于前面两项之和。图方便就递归实现，图性能就用循环。</p>
<pre><code class="prism language-python"><span class="token comment"># 递归实现</span>
<span class="token keyword">def</span> <span class="token function">Fib</span><span class="token punctuation">(</span>n<span class="token punctuation">)</span><span class="token punctuation">:</span>
    <span class="token keyword">return</span> <span class="token number">1</span> <span class="token keyword">if</span> n<span class="token operator">&lt;=</span><span class="token number">2</span> <span class="token keyword">else</span> Fib<span class="token punctuation">(</span>n<span class="token operator">-</span><span class="token number">1</span><span class="token punctuation">)</span><span class="token operator">+</span>Fib<span class="token punctuation">(</span>n<span class="token operator">-</span><span class="token number">2</span><span class="token punctuation">)</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>Fib<span class="token punctuation">(</span><span class="token builtin">int</span><span class="token punctuation">(</span><span class="token builtin">input</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
    
<span class="token comment"># 朴素实现</span>
target<span class="token operator">=</span><span class="token builtin">int</span><span class="token punctuation">(</span><span class="token builtin">input</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
res<span class="token operator">=</span><span class="token number">0</span>
a<span class="token punctuation">,</span>b<span class="token operator">=</span><span class="token number">1</span><span class="token punctuation">,</span><span class="token number">1</span>
<span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span>target<span class="token operator">-</span><span class="token number">1</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
    a<span class="token punctuation">,</span>b<span class="token operator">=</span>b<span class="token punctuation">,</span>a<span class="token operator">+</span>b
<span class="token keyword">print</span><span class="token punctuation">(</span>a<span class="token punctuation">)</span>

</code></pre>
<h4><a id="007copy_169"></a>实例007：copy</h4>
<p><strong>题目</strong> 将一个列表的数据复制到另一个列表中。</p>
<p><strong>程序分析</strong> 使用列表[:]，拿不准可以调用copy模块。</p>
<pre><code class="prism language-python"><span class="token keyword">import</span> copy
a <span class="token operator">=</span> <span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">,</span><span class="token number">2</span><span class="token punctuation">,</span><span class="token number">3</span><span class="token punctuation">,</span><span class="token number">4</span><span class="token punctuation">,</span><span class="token punctuation">[</span><span class="token string">'a'</span><span class="token punctuation">,</span><span class="token string">'b'</span><span class="token punctuation">]</span><span class="token punctuation">]</span>

b <span class="token operator">=</span> a					<span class="token comment"># 赋值</span>
c <span class="token operator">=</span> a<span class="token punctuation">[</span><span class="token punctuation">:</span><span class="token punctuation">]</span>				<span class="token comment"># 浅拷贝</span>
d <span class="token operator">=</span> copy<span class="token punctuation">.</span>copy<span class="token punctuation">(</span>a<span class="token punctuation">)</span>		<span class="token comment"># 浅拷贝</span>
e <span class="token operator">=</span> copy<span class="token punctuation">.</span>deepcopy<span class="token punctuation">(</span>a<span class="token punctuation">)</span>	<span class="token comment"># 深拷贝</span>

a<span class="token punctuation">.</span>append<span class="token punctuation">(</span><span class="token number">5</span><span class="token punctuation">)</span>
a<span class="token punctuation">[</span><span class="token number">4</span><span class="token punctuation">]</span><span class="token punctuation">.</span>append<span class="token punctuation">(</span><span class="token string">'c'</span><span class="token punctuation">)</span>

<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">'a='</span><span class="token punctuation">,</span>a<span class="token punctuation">)</span>
<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">'b='</span><span class="token punctuation">,</span>b<span class="token punctuation">)</span>
<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">'c='</span><span class="token punctuation">,</span>c<span class="token punctuation">)</span>
<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">'d='</span><span class="token punctuation">,</span>d<span class="token punctuation">)</span>
<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">'e='</span><span class="token punctuation">,</span>e<span class="token punctuation">)</span>

<span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span> RESTART<span class="token punctuation">:</span> F<span class="token punctuation">:</span>\PyWorkspace\Python100\100examples\<span class="token number">007.</span>py <span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span>
a<span class="token operator">=</span> <span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">,</span> <span class="token number">2</span><span class="token punctuation">,</span> <span class="token number">3</span><span class="token punctuation">,</span> <span class="token number">4</span><span class="token punctuation">,</span> <span class="token punctuation">[</span><span class="token string">'a'</span><span class="token punctuation">,</span> <span class="token string">'b'</span><span class="token punctuation">,</span> <span class="token string">'c'</span><span class="token punctuation">]</span><span class="token punctuation">,</span> <span class="token number">5</span><span class="token punctuation">]</span>
b<span class="token operator">=</span> <span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">,</span> <span class="token number">2</span><span class="token punctuation">,</span> <span class="token number">3</span><span class="token punctuation">,</span> <span class="token number">4</span><span class="token punctuation">,</span> <span class="token punctuation">[</span><span class="token string">'a'</span><span class="token punctuation">,</span> <span class="token string">'b'</span><span class="token punctuation">,</span> <span class="token string">'c'</span><span class="token punctuation">]</span><span class="token punctuation">,</span> <span class="token number">5</span><span class="token punctuation">]</span>
c<span class="token operator">=</span> <span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">,</span> <span class="token number">2</span><span class="token punctuation">,</span> <span class="token number">3</span><span class="token punctuation">,</span> <span class="token number">4</span><span class="token punctuation">,</span> <span class="token punctuation">[</span><span class="token string">'a'</span><span class="token punctuation">,</span> <span class="token string">'b'</span><span class="token punctuation">,</span> <span class="token string">'c'</span><span class="token punctuation">]</span><span class="token punctuation">]</span>
d<span class="token operator">=</span> <span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">,</span> <span class="token number">2</span><span class="token punctuation">,</span> <span class="token number">3</span><span class="token punctuation">,</span> <span class="token number">4</span><span class="token punctuation">,</span> <span class="token punctuation">[</span><span class="token string">'a'</span><span class="token punctuation">,</span> <span class="token string">'b'</span><span class="token punctuation">,</span> <span class="token string">'c'</span><span class="token punctuation">]</span><span class="token punctuation">]</span>
e<span class="token operator">=</span> <span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">,</span> <span class="token number">2</span><span class="token punctuation">,</span> <span class="token number">3</span><span class="token punctuation">,</span> <span class="token number">4</span><span class="token punctuation">,</span> <span class="token punctuation">[</span><span class="token string">'a'</span><span class="token punctuation">,</span> <span class="token string">'b'</span><span class="token punctuation">]</span><span class="token punctuation">]</span>
</code></pre>
<h4><a id="008_201"></a>实例008：九九乘法表</h4>
<p><strong>题目</strong> 输出 9*9 乘法口诀表。</p>
<p><strong>程序分析</strong> 分行与列考虑，共9行9列，i控制行，j控制列。</p>
<pre><code class="prism language-python"><span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token number">1</span><span class="token punctuation">,</span><span class="token number">10</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
    <span class="token keyword">for</span> j <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token number">1</span><span class="token punctuation">,</span>i<span class="token operator">+</span><span class="token number">1</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
        <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">'%d*%d=%2ld '</span><span class="token operator">%</span><span class="token punctuation">(</span>i<span class="token punctuation">,</span>j<span class="token punctuation">,</span>i<span class="token operator">*</span>j<span class="token punctuation">)</span><span class="token punctuation">,</span>end<span class="token operator">=</span><span class="token string">''</span><span class="token punctuation">)</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token punctuation">)</span>
</code></pre>
<h4><a id="009_214"></a>实例009：暂停一秒输出</h4>
<p><strong>题目</strong> 暂停一秒输出。</p>
<p><strong>程序分析</strong> 使用 time 模块的 sleep() 函数。</p>
<pre><code class="prism language-python"><span class="token keyword">import</span> time
<span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token number">4</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token builtin">str</span><span class="token punctuation">(</span><span class="token builtin">int</span><span class="token punctuation">(</span>time<span class="token punctuation">.</span>time<span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">[</span><span class="token operator">-</span><span class="token number">2</span><span class="token punctuation">:</span><span class="token punctuation">]</span><span class="token punctuation">)</span>
    time<span class="token punctuation">.</span>sleep<span class="token punctuation">(</span><span class="token number">1</span><span class="token punctuation">)</span>
</code></pre>
<h4><a id="010_227"></a>实例010：给人看的时间</h4>
<p><strong>题目</strong> 暂停一秒输出，并格式化当前时间。</p>
<p><strong>程序分析</strong> 同009.</p>
<pre><code class="prism language-python"><span class="token keyword">import</span> time

<span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token number">4</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span>time<span class="token punctuation">.</span>strftime<span class="token punctuation">(</span><span class="token string">'%Y-%m-%d %H:%M:%S'</span><span class="token punctuation">,</span>time<span class="token punctuation">.</span>localtime<span class="token punctuation">(</span>time<span class="token punctuation">.</span>time<span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
    time<span class="token punctuation">.</span>sleep<span class="token punctuation">(</span><span class="token number">1</span><span class="token punctuation">)</span>
</code></pre>
<h4><a id="011_241"></a>实例011：养兔子</h4>
<p><strong>题目</strong> 有一对兔子，从出生后第3个月起每个月都生一对兔子，小兔子长到第三个月后每个月又生一对兔子，假如兔子都不死，问每个月的兔子总数为多少？</p>
<p><strong>程序分析</strong> 我认为原文的解法有点扯，没有考虑3个月成熟的问题，人家还是婴儿怎么生孩子？考虑到三个月成熟，可以构建四个数据，其中：一月兔每个月长大成为二月兔，二月兔变三月兔，三月兔变成年兔，成年兔（包括新成熟的三月兔）生等量的一月兔。</p>
<pre><code class="prism language-python">month<span class="token operator">=</span><span class="token builtin">int</span><span class="token punctuation">(</span><span class="token builtin">input</span><span class="token punctuation">(</span><span class="token string">'繁殖几个月？： '</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
month_1<span class="token operator">=</span><span class="token number">1</span>
month_2<span class="token operator">=</span><span class="token number">0</span>
month_3<span class="token operator">=</span><span class="token number">0</span>
month_elder<span class="token operator">=</span><span class="token number">0</span>
<span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span>month<span class="token punctuation">)</span><span class="token punctuation">:</span>
    month_1<span class="token punctuation">,</span>month_2<span class="token punctuation">,</span>month_3<span class="token punctuation">,</span>month_elder<span class="token operator">=</span>month_elder<span class="token operator">+</span>month_3<span class="token punctuation">,</span>month_1<span class="token punctuation">,</span>month_2<span class="token punctuation">,</span>month_elder<span class="token operator">+</span>month_3
    <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">'第%d个月共'</span><span class="token operator">%</span><span class="token punctuation">(</span>i<span class="token operator">+</span><span class="token number">1</span><span class="token punctuation">)</span><span class="token punctuation">,</span>month_1<span class="token operator">+</span>month_2<span class="token operator">+</span>month_3<span class="token operator">+</span>month_elder<span class="token punctuation">,</span><span class="token string">'对兔子'</span><span class="token punctuation">)</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">'其中1月兔：'</span><span class="token punctuation">,</span>month_1<span class="token punctuation">)</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">'其中2月兔：'</span><span class="token punctuation">,</span>month_2<span class="token punctuation">)</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">'其中3月兔：'</span><span class="token punctuation">,</span>month_3<span class="token punctuation">)</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">'其中成年兔：'</span><span class="token punctuation">,</span>month_elder<span class="token punctuation">)</span>
</code></pre>
<h4><a id="012100200_262"></a>实例012：100到200的素数</h4>
<p><strong>题目</strong> 判断101-200之间有多少个素数，并输出所有素数。</p>
<p><strong>程序分析</strong> 判断素数的方法：用一个数分别去除2到sqrt(这个数)，如果能被整除，则表明此数不是素数，反之是素数。 用else可以进一步简化代码.</p>
<pre><code class="prism language-python"><span class="token keyword">import</span> math
<span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token number">100</span><span class="token punctuation">,</span><span class="token number">200</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
    flag<span class="token operator">=</span><span class="token number">0</span>
    <span class="token keyword">for</span> j <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token number">2</span><span class="token punctuation">,</span><span class="token builtin">round</span><span class="token punctuation">(</span>math<span class="token punctuation">.</span>sqrt<span class="token punctuation">(</span>i<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token operator">+</span><span class="token number">1</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
        <span class="token keyword">if</span> i<span class="token operator">%</span>j<span class="token operator">==</span><span class="token number">0</span><span class="token punctuation">:</span>
            flag<span class="token operator">=</span><span class="token number">1</span>
            <span class="token keyword">break</span>
    <span class="token keyword">if</span> flag<span class="token punctuation">:</span>
        <span class="token keyword">continue</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span>i<span class="token punctuation">)</span>


<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">'\nSimplify the code with "else"\n'</span><span class="token punctuation">)</span>


<span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token number">100</span><span class="token punctuation">,</span><span class="token number">200</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
    <span class="token keyword">for</span> j <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token number">2</span><span class="token punctuation">,</span><span class="token builtin">round</span><span class="token punctuation">(</span>math<span class="token punctuation">.</span>sqrt<span class="token punctuation">(</span>i<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token operator">+</span><span class="token number">1</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
        <span class="token keyword">if</span> i<span class="token operator">%</span>j<span class="token operator">==</span><span class="token number">0</span><span class="token punctuation">:</span>
            <span class="token keyword">break</span>
    <span class="token keyword">else</span><span class="token punctuation">:</span>
        <span class="token keyword">print</span><span class="token punctuation">(</span>i<span class="token punctuation">)</span>
</code></pre>
<h4><a id="013_292"></a>实例013：所有水仙花数</h4>
<p><strong>题目</strong> 打印出所有的"水仙花数"，所谓"水仙花数"是指一个三位数，其各位数字立方和等于该数本身。例如：153是一个"水仙花数"，因为153=1的三次方＋5的三次方＋3的三次方。</p>
<p><strong>程序分析</strong> 利用for循环控制100-999个数，每个数分解出个位，十位，百位。</p>
<pre><code class="prism language-python"><span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token number">100</span><span class="token punctuation">,</span><span class="token number">1000</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
    s<span class="token operator">=</span><span class="token builtin">str</span><span class="token punctuation">(</span>i<span class="token punctuation">)</span>
    one<span class="token operator">=</span><span class="token builtin">int</span><span class="token punctuation">(</span>s<span class="token punctuation">[</span><span class="token operator">-</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">)</span>
    ten<span class="token operator">=</span><span class="token builtin">int</span><span class="token punctuation">(</span>s<span class="token punctuation">[</span><span class="token operator">-</span><span class="token number">2</span><span class="token punctuation">]</span><span class="token punctuation">)</span>
    hun<span class="token operator">=</span><span class="token builtin">int</span><span class="token punctuation">(</span>s<span class="token punctuation">[</span><span class="token operator">-</span><span class="token number">3</span><span class="token punctuation">]</span><span class="token punctuation">)</span>
    <span class="token keyword">if</span> i <span class="token operator">==</span> one<span class="token operator">**</span><span class="token number">3</span><span class="token operator">+</span>ten<span class="token operator">**</span><span class="token number">3</span><span class="token operator">+</span>hun<span class="token operator">**</span><span class="token number">3</span><span class="token punctuation">:</span>
        <span class="token keyword">print</span><span class="token punctuation">(</span>i<span class="token punctuation">)</span>
</code></pre>
<h4><a id="014_308"></a>实例014：分解质因数</h4>
<p><strong>题目</strong> 将一个整数分解质因数。例如：输入90,打印出90=2<em>3</em>3*5。</p>
<p><strong>程序分析</strong> 根本不需要判断是否是质数，从2开始向数本身遍历，能整除的肯定是最小的质数。</p>
<pre><code class="prism language-python">target<span class="token operator">=</span><span class="token builtin">int</span><span class="token punctuation">(</span><span class="token builtin">input</span><span class="token punctuation">(</span><span class="token string">'输入一个整数：'</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>target<span class="token punctuation">,</span><span class="token string">'= '</span><span class="token punctuation">,</span>end<span class="token operator">=</span><span class="token string">''</span><span class="token punctuation">)</span>

<span class="token keyword">if</span> target<span class="token operator">&lt;</span><span class="token number">0</span><span class="token punctuation">:</span>
    target<span class="token operator">=</span><span class="token builtin">abs</span><span class="token punctuation">(</span>target<span class="token punctuation">)</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">'-1*'</span><span class="token punctuation">,</span>end<span class="token operator">=</span><span class="token string">''</span><span class="token punctuation">)</span>

flag<span class="token operator">=</span><span class="token number">0</span>
<span class="token keyword">if</span> target<span class="token operator">&lt;=</span><span class="token number">1</span><span class="token punctuation">:</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span>target<span class="token punctuation">)</span>
    flag<span class="token operator">=</span><span class="token number">1</span>


<span class="token keyword">while</span> <span class="token boolean">True</span><span class="token punctuation">:</span>
    <span class="token keyword">if</span> flag<span class="token punctuation">:</span>
        <span class="token keyword">break</span>
    <span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token number">2</span><span class="token punctuation">,</span><span class="token builtin">int</span><span class="token punctuation">(</span>target<span class="token operator">+</span><span class="token number">1</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
        <span class="token keyword">if</span> target<span class="token operator">%</span>i<span class="token operator">==</span><span class="token number">0</span><span class="token punctuation">:</span>
            <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">"%d"</span><span class="token operator">%</span>i<span class="token punctuation">,</span>end<span class="token operator">=</span><span class="token string">''</span><span class="token punctuation">)</span>
            <span class="token keyword">if</span> target<span class="token operator">==</span>i<span class="token punctuation">:</span>
                flag<span class="token operator">=</span><span class="token number">1</span>
                <span class="token keyword">break</span>
            <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">'*'</span><span class="token punctuation">,</span>end<span class="token operator">=</span><span class="token string">''</span><span class="token punctuation">)</span>
            target<span class="token operator">/=</span>i
            <span class="token keyword">break</span>
        
</code></pre>
<h4><a id="015_343"></a>实例015：分数归档</h4>
<p><strong>题目</strong> 利用条件运算符的嵌套来完成此题：学习成绩&gt;=90分的同学用A表示，60-89分之间的用B表示，60分以下的用C表示。</p>
<p><strong>程序分析</strong> 用条件判断即可。</p>
<pre><code class="prism language-python">points<span class="token operator">=</span><span class="token builtin">int</span><span class="token punctuation">(</span><span class="token builtin">input</span><span class="token punctuation">(</span><span class="token string">'输入分数：'</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
<span class="token keyword">if</span> points<span class="token operator">&gt;=</span><span class="token number">90</span><span class="token punctuation">:</span>
    grade<span class="token operator">=</span><span class="token string">'A'</span>
<span class="token keyword">elif</span> points<span class="token operator">&lt;</span><span class="token number">60</span><span class="token punctuation">:</span>
    grade<span class="token operator">=</span><span class="token string">'C'</span>
<span class="token keyword">else</span><span class="token punctuation">:</span>
    grade<span class="token operator">=</span><span class="token string">'B'</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>grade<span class="token punctuation">)</span>
</code></pre>
<h4><a id="016_360"></a>实例016：输出日期</h4>
<p><strong>题目</strong> 输出指定格式的日期。</p>
<p><strong>程序分析</strong> 使用 datetime 模块。</p>
<pre><code class="prism language-python"><span class="token keyword">import</span> datetime
<span class="token keyword">print</span><span class="token punctuation">(</span>datetime<span class="token punctuation">.</span>date<span class="token punctuation">.</span>today<span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>datetime<span class="token punctuation">.</span>date<span class="token punctuation">(</span><span class="token number">2333</span><span class="token punctuation">,</span><span class="token number">2</span><span class="token punctuation">,</span><span class="token number">3</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>datetime<span class="token punctuation">.</span>date<span class="token punctuation">.</span>today<span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">.</span>strftime<span class="token punctuation">(</span><span class="token string">'%d/%m/%Y'</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
day<span class="token operator">=</span>datetime<span class="token punctuation">.</span>date<span class="token punctuation">(</span><span class="token number">1111</span><span class="token punctuation">,</span><span class="token number">2</span><span class="token punctuation">,</span><span class="token number">3</span><span class="token punctuation">)</span>
day<span class="token operator">=</span>day<span class="token punctuation">.</span>replace<span class="token punctuation">(</span>year<span class="token operator">=</span>day<span class="token punctuation">.</span>year<span class="token operator">+</span><span class="token number">22</span><span class="token punctuation">)</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>day<span class="token punctuation">)</span>
</code></pre>
<h4><a id="017_376"></a>实例017：字符串构成</h4>
<p><strong>题目</strong> 输入一行字符，分别统计出其中英文字母、空格、数字和其它字符的个数。</p>
<p><strong>程序分析</strong> 利用 while 或 for 语句,条件为输入的字符不为 ‘\n’。</p>
<pre><code class="prism language-python">string<span class="token operator">=</span><span class="token builtin">input</span><span class="token punctuation">(</span><span class="token string">"输入字符串："</span><span class="token punctuation">)</span>
alp<span class="token operator">=</span><span class="token number">0</span>
num<span class="token operator">=</span><span class="token number">0</span>
spa<span class="token operator">=</span><span class="token number">0</span>
oth<span class="token operator">=</span><span class="token number">0</span>
<span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token builtin">len</span><span class="token punctuation">(</span>string<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
    <span class="token keyword">if</span> string<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">.</span>isspace<span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
        spa<span class="token operator">+=</span><span class="token number">1</span>
    <span class="token keyword">elif</span> string<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">.</span>isdigit<span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
        num<span class="token operator">+=</span><span class="token number">1</span>
    <span class="token keyword">elif</span> string<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">.</span>isalpha<span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
        alp<span class="token operator">+=</span><span class="token number">1</span>
    <span class="token keyword">else</span><span class="token punctuation">:</span>
        oth<span class="token operator">+=</span><span class="token number">1</span>
<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">'space: '</span><span class="token punctuation">,</span>spa<span class="token punctuation">)</span>
<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">'digit: '</span><span class="token punctuation">,</span>num<span class="token punctuation">)</span>
<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">'alpha: '</span><span class="token punctuation">,</span>alp<span class="token punctuation">)</span>
<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">'other: '</span><span class="token punctuation">,</span>oth<span class="token punctuation">)</span>

</code></pre>
<h4><a id="018_404"></a>实例018：复读机相加</h4>
<p><strong>题目</strong> 求s=a+aa+aaa+aaaa+aa…a的值，其中a是一个数字。例如2+22+222+2222+22222(此时共有5个数相加)，几个数相加由键盘控制。</p>
<p><strong>程序分析</strong> 用字符串解决。</p>
<pre><code class="prism language-python">a<span class="token operator">=</span><span class="token builtin">input</span><span class="token punctuation">(</span><span class="token string">'被加数字：'</span><span class="token punctuation">)</span>
n<span class="token operator">=</span><span class="token builtin">int</span><span class="token punctuation">(</span><span class="token builtin">input</span><span class="token punctuation">(</span><span class="token string">'加几次？：'</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
res<span class="token operator">=</span><span class="token number">0</span>
<span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span>n<span class="token punctuation">)</span><span class="token punctuation">:</span>
    res<span class="token operator">+=</span><span class="token builtin">int</span><span class="token punctuation">(</span>a<span class="token punctuation">)</span>
    a<span class="token operator">+=</span>a<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span>
<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">'结果是：'</span><span class="token punctuation">,</span>res<span class="token punctuation">)</span>
</code></pre>
<h4><a id="019_420"></a>实例019：完数</h4>
<p><strong>题目</strong> 一个数如果恰好等于它的因子之和，这个数就称为"完数"。例如6=1＋2＋3.编程找出1000以内的所有完数。</p>
<p><strong>程序分析</strong> 将每一对因子加进集合，在这个过程中已经自动去重。最后的结果要求不计算其本身。</p>
<pre><code class="prism language-python"><span class="token keyword">def</span> <span class="token function">factor</span><span class="token punctuation">(</span>num<span class="token punctuation">)</span><span class="token punctuation">:</span>
    target<span class="token operator">=</span><span class="token builtin">int</span><span class="token punctuation">(</span>num<span class="token punctuation">)</span>
    res<span class="token operator">=</span><span class="token builtin">set</span><span class="token punctuation">(</span><span class="token punctuation">)</span>
    <span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token number">1</span><span class="token punctuation">,</span>num<span class="token punctuation">)</span><span class="token punctuation">:</span>
        <span class="token keyword">if</span> num<span class="token operator">%</span>i<span class="token operator">==</span><span class="token number">0</span><span class="token punctuation">:</span>
            res<span class="token punctuation">.</span>add<span class="token punctuation">(</span>i<span class="token punctuation">)</span>
            res<span class="token punctuation">.</span>add<span class="token punctuation">(</span>num<span class="token operator">/</span>i<span class="token punctuation">)</span>
    <span class="token keyword">return</span> res

<span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token number">2</span><span class="token punctuation">,</span><span class="token number">1001</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
    <span class="token keyword">if</span> i<span class="token operator">==</span><span class="token builtin">sum</span><span class="token punctuation">(</span>factor<span class="token punctuation">(</span>i<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token operator">-</span>i<span class="token punctuation">:</span>
        <span class="token keyword">print</span><span class="token punctuation">(</span>i<span class="token punctuation">)</span>
</code></pre>
<h4><a id="020_441"></a>实例020：高空抛物</h4>
<p><strong>题目</strong> 一球从100米高度自由落下，每次落地后反跳回原高度的一半；再落下，求它在第10次落地时，共经过多少米？第10次反弹多高？</p>
<p><strong>程序分析</strong> 无</p>
<pre><code class="prism language-python">high<span class="token operator">=</span><span class="token number">200</span><span class="token punctuation">.</span>
total<span class="token operator">=</span><span class="token number">100</span>
<span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token number">10</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
    high<span class="token operator">/=</span><span class="token number">2</span>
    total<span class="token operator">+=</span>high
    <span class="token keyword">print</span><span class="token punctuation">(</span>high<span class="token operator">/</span><span class="token number">2</span><span class="token punctuation">)</span>
<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">'总长：'</span><span class="token punctuation">,</span>total<span class="token punctuation">)</span>
</code></pre>
<h4><a id="021_457"></a>实例021：猴子偷桃</h4>
<p><strong>题目</strong> 猴子吃桃问题：猴子第一天摘下若干个桃子，当即吃了一半，还不瘾，又多吃了一个第二天早上又将剩下的桃子吃掉一半，又多吃了一个。以后每天早上都吃了前一天剩下的一半零一个。到第10天早上想再吃时，见只剩下一个桃子了。求第一天共摘了多少。</p>
<p><strong>程序分析</strong> 按规则反向推断：猴子有一个桃子，他偷来一个桃子，觉得不够又偷来了与手上等量的桃子，一共偷了9天。</p>
<pre><code class="prism language-python">peach<span class="token operator">=</span><span class="token number">1</span>
<span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token number">9</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
    peach<span class="token operator">=</span><span class="token punctuation">(</span>peach<span class="token operator">+</span><span class="token number">1</span><span class="token punctuation">)</span><span class="token operator">*</span><span class="token number">2</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>peach<span class="token punctuation">)</span>
</code></pre>
<h4><a id="022_470"></a>实例022：比赛对手</h4>
<p><strong>题目</strong> 两个乒乓球队进行比赛，各出三人。甲队为a,b,c三人，乙队为x,y,z三人。已抽签决定比赛名单。有人向队员打听比赛的名单。a说他不和x比，c说他不和x,z比，请编程序找出三队赛手的名单。</p>
<p><strong>程序分析</strong> 找到条件下不重复的三个对手即可。</p>
<pre><code class="prism language-python">a<span class="token operator">=</span><span class="token builtin">set</span><span class="token punctuation">(</span><span class="token punctuation">[</span><span class="token string">'x'</span><span class="token punctuation">,</span><span class="token string">'y'</span><span class="token punctuation">,</span><span class="token string">'z'</span><span class="token punctuation">]</span><span class="token punctuation">)</span>
b<span class="token operator">=</span><span class="token builtin">set</span><span class="token punctuation">(</span><span class="token punctuation">[</span><span class="token string">'x'</span><span class="token punctuation">,</span><span class="token string">'y'</span><span class="token punctuation">,</span><span class="token string">'z'</span><span class="token punctuation">]</span><span class="token punctuation">)</span>
c<span class="token operator">=</span><span class="token builtin">set</span><span class="token punctuation">(</span><span class="token punctuation">[</span><span class="token string">'x'</span><span class="token punctuation">,</span><span class="token string">'y'</span><span class="token punctuation">,</span><span class="token string">'z'</span><span class="token punctuation">]</span><span class="token punctuation">)</span>
c<span class="token operator">-=</span><span class="token builtin">set</span><span class="token punctuation">(</span><span class="token punctuation">(</span><span class="token string">'x'</span><span class="token punctuation">,</span><span class="token string">'z'</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
a<span class="token operator">-=</span><span class="token builtin">set</span><span class="token punctuation">(</span><span class="token string">'x'</span><span class="token punctuation">)</span>
<span class="token keyword">for</span> i <span class="token keyword">in</span> a<span class="token punctuation">:</span>
    <span class="token keyword">for</span> j <span class="token keyword">in</span> b<span class="token punctuation">:</span>
        <span class="token keyword">for</span> k <span class="token keyword">in</span> c<span class="token punctuation">:</span>
            <span class="token keyword">if</span> <span class="token builtin">len</span><span class="token punctuation">(</span><span class="token builtin">set</span><span class="token punctuation">(</span><span class="token punctuation">(</span>i<span class="token punctuation">,</span>j<span class="token punctuation">,</span>k<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token operator">==</span><span class="token number">3</span><span class="token punctuation">:</span>
                <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">'a:%s,b:%s,c:%s'</span><span class="token operator">%</span><span class="token punctuation">(</span>i<span class="token punctuation">,</span>j<span class="token punctuation">,</span>k<span class="token punctuation">)</span><span class="token punctuation">)</span>
</code></pre>
<h4><a id="023_489"></a>实例023：画菱形</h4>
<p><strong>题目</strong> 打印出如下图案（菱形）:</p>
<blockquote>
<p>&nbsp;&nbsp;&nbsp;&nbsp;*<br>
&nbsp;&nbsp;&nbsp;***<br>
&nbsp;&nbsp;*****<br>
&nbsp;*******<br>
&nbsp;&nbsp;*****<br>
&nbsp;&nbsp;&nbsp;***<br>
&nbsp;&nbsp;&nbsp;&nbsp;*</p>
</blockquote>
<p><strong>程序分析</strong> 递归调用即可。</p>
<pre><code class="prism language-python"><span class="token keyword">def</span> <span class="token function">draw</span><span class="token punctuation">(</span>num<span class="token punctuation">)</span><span class="token punctuation">:</span>
    a<span class="token operator">=</span><span class="token string">"*"</span><span class="token operator">*</span><span class="token punctuation">(</span><span class="token number">2</span><span class="token operator">*</span><span class="token punctuation">(</span><span class="token number">4</span><span class="token operator">-</span>num<span class="token punctuation">)</span><span class="token operator">+</span><span class="token number">1</span><span class="token punctuation">)</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span>a<span class="token punctuation">.</span>center<span class="token punctuation">(</span><span class="token number">9</span><span class="token punctuation">,</span><span class="token string">' '</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
    <span class="token keyword">if</span> num<span class="token operator">!=</span><span class="token number">1</span><span class="token punctuation">:</span>
        draw<span class="token punctuation">(</span>num<span class="token operator">-</span><span class="token number">1</span><span class="token punctuation">)</span>
        <span class="token keyword">print</span><span class="token punctuation">(</span>a<span class="token punctuation">.</span>center<span class="token punctuation">(</span><span class="token number">9</span><span class="token punctuation">,</span><span class="token string">' '</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
draw<span class="token punctuation">(</span><span class="token number">4</span><span class="token punctuation">)</span>
</code></pre>
<h4><a id="024II_513"></a>实例024：斐波那契数列II</h4>
<p><strong>题目</strong> 有一分数序列：2/1，3/2，5/3，8/5，13/8，21/13…求出这个数列的前20项之和。</p>
<p><strong>程序分析</strong> 就是斐波那契数列的后一项除以前一项。</p>
<pre><code class="prism language-python">a <span class="token operator">=</span> <span class="token number">2.0</span>
b <span class="token operator">=</span> <span class="token number">1.0</span>
s <span class="token operator">=</span> <span class="token number">0</span>
<span class="token keyword">for</span> n <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token number">1</span><span class="token punctuation">,</span><span class="token number">21</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
    s <span class="token operator">+=</span> a <span class="token operator">/</span> b
    a<span class="token punctuation">,</span>b <span class="token operator">=</span> a <span class="token operator">+</span> b<span class="token punctuation">,</span>a
<span class="token keyword">print</span> <span class="token punctuation">(</span>s<span class="token punctuation">)</span>

</code></pre>
<h4><a id="025__530"></a>实例025： 阶乘求和</h4>
<p><strong>题目</strong> 求1+2!+3!+…+20!的和。</p>
<p><strong>程序分析</strong> 1+2!+3!+…+20!=1+2(1+3(1+4(…20(1))))</p>
<pre><code class="prism language-python">res<span class="token operator">=</span><span class="token number">1</span>
<span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token number">20</span><span class="token punctuation">,</span><span class="token number">1</span><span class="token punctuation">,</span><span class="token operator">-</span><span class="token number">1</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
    res<span class="token operator">=</span>i<span class="token operator">*</span>res<span class="token operator">+</span><span class="token number">1</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>res<span class="token punctuation">)</span>
</code></pre>
<h4><a id="026_543"></a>实例026：递归求阶乘</h4>
<p><strong>题目</strong> 利用递归方法求5!。</p>
<p><strong>程序分析</strong> 递归调用即可。</p>
<pre><code class="prism language-python"><span class="token keyword">def</span> <span class="token function">factorial</span><span class="token punctuation">(</span>n<span class="token punctuation">)</span><span class="token punctuation">:</span>
    <span class="token keyword">return</span> n<span class="token operator">*</span>factorial<span class="token punctuation">(</span>n<span class="token operator">-</span><span class="token number">1</span><span class="token punctuation">)</span> <span class="token keyword">if</span> n<span class="token operator">&gt;</span><span class="token number">1</span> <span class="token keyword">else</span> <span class="token number">1</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>factorial<span class="token punctuation">(</span><span class="token number">5</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
</code></pre>
<h4><a id="027_555"></a>实例027：递归输出</h4>
<p><strong>题目</strong> 利用递归函数调用方式，将所输入的5个字符，以相反顺序打印出来。</p>
<p><strong>程序分析</strong> 递归真是蠢方法。</p>
<pre><code class="prism language-python"><span class="token keyword">def</span> <span class="token function">rec</span><span class="token punctuation">(</span>string<span class="token punctuation">)</span><span class="token punctuation">:</span>
    <span class="token keyword">if</span> <span class="token builtin">len</span><span class="token punctuation">(</span>string<span class="token punctuation">)</span><span class="token operator">!=</span><span class="token number">1</span><span class="token punctuation">:</span>
        rec<span class="token punctuation">(</span>string<span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">:</span><span class="token punctuation">]</span><span class="token punctuation">)</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span>string<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">,</span>end<span class="token operator">=</span><span class="token string">''</span><span class="token punctuation">)</span>

rec<span class="token punctuation">(</span><span class="token builtin">input</span><span class="token punctuation">(</span><span class="token string">'string here:'</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
</code></pre>
<h4><a id="028_570"></a>实例028：递归求等差数列</h4>
<p><strong>题目</strong> 有5个人坐在一起，问第五个人多少岁？他说比第4个人大2岁。问第4个人岁数，他说比第3个人大2岁。问第三个人，又说比第2人大两岁。问第2个人，说比第一个人大两岁。最后问第一个人，他说是10岁。请问第五个人多大？</p>
<p><strong>程序分析</strong> 就一等差数列。</p>
<pre><code class="prism language-python"><span class="token keyword">def</span> <span class="token function">age</span><span class="token punctuation">(</span>n<span class="token punctuation">)</span><span class="token punctuation">:</span>
    <span class="token keyword">if</span> n<span class="token operator">==</span><span class="token number">1</span><span class="token punctuation">:</span>
        <span class="token keyword">return</span> <span class="token number">10</span>
    <span class="token keyword">return</span> <span class="token number">2</span><span class="token operator">+</span>age<span class="token punctuation">(</span>n<span class="token operator">-</span><span class="token number">1</span><span class="token punctuation">)</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>age<span class="token punctuation">(</span><span class="token number">5</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
</code></pre>
<h4><a id="029_584"></a>实例029：反向输出</h4>
<p><strong>题目</strong> 给一个不多于5位的正整数，要求：一、求它是几位数，二、逆序打印出各位数字。</p>
<p><strong>程序分析</strong> 学会分解出每一位数,用字符串的方法总是比较省事。</p>
<pre><code class="prism language-python">n<span class="token operator">=</span><span class="token builtin">int</span><span class="token punctuation">(</span><span class="token builtin">input</span><span class="token punctuation">(</span><span class="token string">'输入一个正整数：'</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
n<span class="token operator">=</span><span class="token builtin">str</span><span class="token punctuation">(</span>n<span class="token punctuation">)</span>
<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">'%d位数'</span><span class="token operator">%</span><span class="token builtin">len</span><span class="token punctuation">(</span>n<span class="token punctuation">)</span><span class="token punctuation">)</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>n<span class="token punctuation">[</span><span class="token punctuation">:</span><span class="token punctuation">:</span><span class="token operator">-</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">)</span>
</code></pre>
<h4><a id="030_597"></a>实例030：回文数</h4>
<p><strong>题目</strong> 一个5位数，判断它是不是回文数。即12321是回文数，个位与万位相同，十位与千位相同。</p>
<p><strong>程序分析</strong> 用字符串比较方便,就算输入的不是数字都ok。</p>
<pre><code class="prism language-python">n<span class="token operator">=</span><span class="token builtin">input</span><span class="token punctuation">(</span><span class="token string">"随便你输入啥啦："</span><span class="token punctuation">)</span>
a<span class="token operator">=</span><span class="token number">0</span>
b<span class="token operator">=</span><span class="token builtin">len</span><span class="token punctuation">(</span>n<span class="token punctuation">)</span><span class="token operator">-</span><span class="token number">1</span>
flag<span class="token operator">=</span><span class="token boolean">True</span>
<span class="token keyword">while</span> a<span class="token operator">&lt;</span>b<span class="token punctuation">:</span>
    <span class="token keyword">if</span> n<span class="token punctuation">[</span>a<span class="token punctuation">]</span><span class="token operator">!=</span>n<span class="token punctuation">[</span>b<span class="token punctuation">]</span><span class="token punctuation">:</span>
        <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">'不是回文串'</span><span class="token punctuation">)</span>
        flag<span class="token operator">=</span><span class="token boolean">False</span>
        <span class="token keyword">break</span>
    a<span class="token punctuation">,</span>b<span class="token operator">=</span>a<span class="token operator">+</span><span class="token number">1</span><span class="token punctuation">,</span>b<span class="token operator">-</span><span class="token number">1</span>
<span class="token keyword">if</span> flag<span class="token punctuation">:</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">'是回文串'</span><span class="token punctuation">)</span>
</code></pre>
<h4><a id="031_618"></a>实例031：字母识词</h4>
<p><strong>题目</strong> 请输入星期几的第一个字母来判断一下是星期几，如果第一个字母一样，则继续判断第二个字母。</p>
<p><strong>程序分析</strong> 这里用字典的形式直接将对照关系存好。</p>
<pre><code class="prism language-python">weekT<span class="token operator">=</span><span class="token punctuation">{</span><span class="token string">'h'</span><span class="token punctuation">:</span><span class="token string">'thursday'</span><span class="token punctuation">,</span>
       <span class="token string">'u'</span><span class="token punctuation">:</span><span class="token string">'tuesday'</span><span class="token punctuation">}</span>
weekS<span class="token operator">=</span><span class="token punctuation">{</span><span class="token string">'a'</span><span class="token punctuation">:</span><span class="token string">'saturday'</span><span class="token punctuation">,</span>
       <span class="token string">'u'</span><span class="token punctuation">:</span><span class="token string">'sunday'</span><span class="token punctuation">}</span>
week<span class="token operator">=</span><span class="token punctuation">{</span><span class="token string">'t'</span><span class="token punctuation">:</span>weekT<span class="token punctuation">,</span>
      <span class="token string">'s'</span><span class="token punctuation">:</span>weekS<span class="token punctuation">,</span>
      <span class="token string">'m'</span><span class="token punctuation">:</span><span class="token string">'monday'</span><span class="token punctuation">,</span>
      <span class="token string">'w'</span><span class="token punctuation">:</span><span class="token string">'wensday'</span><span class="token punctuation">,</span>
      <span class="token string">'f'</span><span class="token punctuation">:</span><span class="token string">'friday'</span><span class="token punctuation">}</span>
a<span class="token operator">=</span>week<span class="token punctuation">[</span><span class="token builtin">str</span><span class="token punctuation">(</span><span class="token builtin">input</span><span class="token punctuation">(</span><span class="token string">'请输入第一位字母:'</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">.</span>lower<span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">]</span>
<span class="token keyword">if</span> a<span class="token operator">==</span>weekT <span class="token operator">or</span> a<span class="token operator">==</span>weekS<span class="token punctuation">:</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span>a<span class="token punctuation">[</span><span class="token builtin">str</span><span class="token punctuation">(</span><span class="token builtin">input</span><span class="token punctuation">(</span><span class="token string">'请输入第二位字母:'</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">.</span>lower<span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">]</span><span class="token punctuation">)</span>
<span class="token keyword">else</span><span class="token punctuation">:</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span>a<span class="token punctuation">)</span>

</code></pre>
<h4><a id="032II_642"></a>实例032：反向输出II</h4>
<p><strong>题目</strong> 按相反的顺序输出列表的值。</p>
<p><strong>程序分析</strong> 无。</p>
<pre><code class="prism language-python">a <span class="token operator">=</span> <span class="token punctuation">[</span><span class="token string">'one'</span><span class="token punctuation">,</span> <span class="token string">'two'</span><span class="token punctuation">,</span> <span class="token string">'three'</span><span class="token punctuation">]</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>a<span class="token punctuation">[</span><span class="token punctuation">:</span><span class="token punctuation">:</span><span class="token operator">-</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">)</span>
</code></pre>
<h4><a id="033_653"></a>实例033：列表转字符串</h4>
<p><strong>题目</strong> 按逗号分隔列表。</p>
<p><strong>程序分析</strong> 无。</p>
<pre><code class="prism language-python">L <span class="token operator">=</span> <span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">,</span><span class="token number">2</span><span class="token punctuation">,</span><span class="token number">3</span><span class="token punctuation">,</span><span class="token number">4</span><span class="token punctuation">,</span><span class="token number">5</span><span class="token punctuation">]</span>
<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">','</span><span class="token punctuation">.</span>join<span class="token punctuation">(</span><span class="token builtin">str</span><span class="token punctuation">(</span>n<span class="token punctuation">)</span> <span class="token keyword">for</span> n <span class="token keyword">in</span> L<span class="token punctuation">)</span><span class="token punctuation">)</span>
</code></pre>
<h4><a id="034_664"></a>实例034：调用函数</h4>
<p><strong>题目</strong> 练习函数调用。</p>
<p><strong>程序分析</strong> 无。</p>
<pre><code class="prism language-python"><span class="token keyword">def</span> <span class="token function">hello</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">'Hello World!'</span><span class="token punctuation">)</span>
<span class="token keyword">def</span> <span class="token function">helloAgain</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
    <span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token number">2</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
        hello<span class="token punctuation">(</span><span class="token punctuation">)</span>

<span class="token keyword">if</span> __name__<span class="token operator">==</span><span class="token string">'__main__'</span><span class="token punctuation">:</span>
    helloAgain<span class="token punctuation">(</span><span class="token punctuation">)</span>
</code></pre>
<h4><a id="035_681"></a>实例035：设置输出颜色</h4>
<p><strong>题目</strong> 文本颜色设置。</p>
<p><strong>程序分析</strong> 无。</p>
<pre><code class="prism language-python"><span class="token keyword">class</span> <span class="token class-name">bcolors</span><span class="token punctuation">:</span>
    HEADER <span class="token operator">=</span> <span class="token string">'\033[95m'</span>
    OKBLUE <span class="token operator">=</span> <span class="token string">'\033[94m'</span>
    OKGREEN <span class="token operator">=</span> <span class="token string">'\033[92m'</span>
    WARNING <span class="token operator">=</span> <span class="token string">'\033[93m'</span>
    FAIL <span class="token operator">=</span> <span class="token string">'\033[91m'</span>
    ENDC <span class="token operator">=</span> <span class="token string">'\033[0m'</span>
    BOLD <span class="token operator">=</span> <span class="token string">'\033[1m'</span>
    UNDERLINE <span class="token operator">=</span> <span class="token string">'\033[4m'</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>bcolors<span class="token punctuation">.</span>WARNING <span class="token operator">+</span> <span class="token string">"警告的颜色字体?"</span> <span class="token operator">+</span> bcolors<span class="token punctuation">.</span>ENDC<span class="token punctuation">)</span>
</code></pre>
<h4><a id="036_700"></a>实例036：算素数</h4>
<p><strong>题目</strong> 求100之内的素数。</p>
<p><strong>程序分析</strong> 用else执行for循环的奖励代码（如果for是正常完结，非break）。</p>
<pre><code class="prism language-python">lo<span class="token operator">=</span><span class="token builtin">int</span><span class="token punctuation">(</span><span class="token builtin">input</span><span class="token punctuation">(</span><span class="token string">'下限：'</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
hi<span class="token operator">=</span><span class="token builtin">int</span><span class="token punctuation">(</span><span class="token builtin">input</span><span class="token punctuation">(</span><span class="token string">'上限：'</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
<span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span>lo<span class="token punctuation">,</span>hi<span class="token operator">+</span><span class="token number">1</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
    <span class="token keyword">if</span> i <span class="token operator">&gt;</span> <span class="token number">1</span><span class="token punctuation">:</span>
        <span class="token keyword">for</span> j <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token number">2</span><span class="token punctuation">,</span>i<span class="token punctuation">)</span><span class="token punctuation">:</span>
            <span class="token keyword">if</span> <span class="token punctuation">(</span>i <span class="token operator">%</span> j<span class="token punctuation">)</span> <span class="token operator">==</span> <span class="token number">0</span><span class="token punctuation">:</span>
                <span class="token keyword">break</span>
        <span class="token keyword">else</span><span class="token punctuation">:</span>
            <span class="token keyword">print</span><span class="token punctuation">(</span>i<span class="token punctuation">)</span>
</code></pre>
<h4><a id="037_718"></a>实例037：排序</h4>
<p><strong>题目</strong> 对10个数进行排序。</p>
<p><strong>程序分析</strong> 同实例005。</p>
<pre><code class="prism language-python">raw<span class="token operator">=</span><span class="token punctuation">[</span><span class="token punctuation">]</span>
<span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token number">10</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
    x<span class="token operator">=</span><span class="token builtin">int</span><span class="token punctuation">(</span><span class="token builtin">input</span><span class="token punctuation">(</span><span class="token string">'int%d: '</span><span class="token operator">%</span><span class="token punctuation">(</span>i<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
    raw<span class="token punctuation">.</span>append<span class="token punctuation">(</span>x<span class="token punctuation">)</span>
    
<span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token builtin">len</span><span class="token punctuation">(</span>raw<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
    <span class="token keyword">for</span> j <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span>i<span class="token punctuation">,</span><span class="token builtin">len</span><span class="token punctuation">(</span>raw<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
        <span class="token keyword">if</span> raw<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token operator">&gt;</span>raw<span class="token punctuation">[</span>j<span class="token punctuation">]</span><span class="token punctuation">:</span>
            raw<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">,</span>raw<span class="token punctuation">[</span>j<span class="token punctuation">]</span><span class="token operator">=</span>raw<span class="token punctuation">[</span>j<span class="token punctuation">]</span><span class="token punctuation">,</span>raw<span class="token punctuation">[</span>i<span class="token punctuation">]</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>raw<span class="token punctuation">)</span>

</code></pre>
<h4><a id="038_738"></a>实例038：矩阵对角线之和</h4>
<p><strong>题目</strong> 求一个3*3矩阵主对角线元素之和。</p>
<p><strong>程序分析</strong> 无。</p>
<pre><code class="prism language-python">mat<span class="token operator">=</span><span class="token punctuation">[</span><span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">,</span><span class="token number">2</span><span class="token punctuation">,</span><span class="token number">3</span><span class="token punctuation">]</span><span class="token punctuation">,</span>
     <span class="token punctuation">[</span><span class="token number">3</span><span class="token punctuation">,</span><span class="token number">4</span><span class="token punctuation">,</span><span class="token number">5</span><span class="token punctuation">]</span><span class="token punctuation">,</span>
     <span class="token punctuation">[</span><span class="token number">4</span><span class="token punctuation">,</span><span class="token number">5</span><span class="token punctuation">,</span><span class="token number">6</span><span class="token punctuation">]</span>
    <span class="token punctuation">]</span>
res<span class="token operator">=</span><span class="token number">0</span>
<span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token builtin">len</span><span class="token punctuation">(</span>mat<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
    res<span class="token operator">+=</span>mat<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">[</span>i<span class="token punctuation">]</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>res<span class="token punctuation">)</span>
</code></pre>
<h4><a id="039_755"></a>实例039：有序列表插入元素</h4>
<p><strong>题目</strong> 有一个已经排好序的数组。现输入一个数，要求按原来的规律将它插入数组中。</p>
<p><strong>程序分析</strong> 首先判断此数是否大于最后一个数，然后再考虑插入中间的数的情况，插入后此元素之后的数，依次后移一个位置。</p>
<pre><code class="prism language-python">lis<span class="token operator">=</span><span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">,</span><span class="token number">10</span><span class="token punctuation">,</span><span class="token number">100</span><span class="token punctuation">,</span><span class="token number">1000</span><span class="token punctuation">,</span><span class="token number">10000</span><span class="token punctuation">,</span><span class="token number">100000</span><span class="token punctuation">]</span>
n<span class="token operator">=</span><span class="token builtin">int</span><span class="token punctuation">(</span><span class="token builtin">input</span><span class="token punctuation">(</span><span class="token string">'insert a number: '</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
lis<span class="token punctuation">.</span>append<span class="token punctuation">(</span>n<span class="token punctuation">)</span>
<span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token builtin">len</span><span class="token punctuation">(</span>lis<span class="token punctuation">)</span><span class="token operator">-</span><span class="token number">1</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
    <span class="token keyword">if</span> lis<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token operator">&gt;=</span>n<span class="token punctuation">:</span>
        <span class="token keyword">for</span> j <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span>i<span class="token punctuation">,</span><span class="token builtin">len</span><span class="token punctuation">(</span>lis<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
            lis<span class="token punctuation">[</span>j<span class="token punctuation">]</span><span class="token punctuation">,</span>lis<span class="token punctuation">[</span><span class="token operator">-</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token operator">=</span>lis<span class="token punctuation">[</span><span class="token operator">-</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">,</span>lis<span class="token punctuation">[</span>j<span class="token punctuation">]</span>
        <span class="token keyword">break</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>lis<span class="token punctuation">)</span>
</code></pre>
<h4><a id="040_773"></a>实例040：逆序列表</h4>
<p><strong>题目</strong> 将一个数组逆序输出。</p>
<p><strong>程序分析</strong> 依次交换位置，或者直接调用reverse方法。</p>
<pre><code class="prism language-python">lis<span class="token operator">=</span><span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">,</span><span class="token number">10</span><span class="token punctuation">,</span><span class="token number">100</span><span class="token punctuation">,</span><span class="token number">1000</span><span class="token punctuation">,</span><span class="token number">10000</span><span class="token punctuation">,</span><span class="token number">100000</span><span class="token punctuation">]</span>
<span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token builtin">int</span><span class="token punctuation">(</span><span class="token builtin">len</span><span class="token punctuation">(</span>lis<span class="token punctuation">)</span><span class="token operator">/</span><span class="token number">2</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
    lis<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">,</span>lis<span class="token punctuation">[</span><span class="token builtin">len</span><span class="token punctuation">(</span>lis<span class="token punctuation">)</span><span class="token operator">-</span><span class="token number">1</span><span class="token operator">-</span>i<span class="token punctuation">]</span><span class="token operator">=</span>lis<span class="token punctuation">[</span><span class="token builtin">len</span><span class="token punctuation">(</span>lis<span class="token punctuation">)</span><span class="token operator">-</span><span class="token number">1</span><span class="token operator">-</span>i<span class="token punctuation">]</span><span class="token punctuation">,</span>lis<span class="token punctuation">[</span>i<span class="token punctuation">]</span>
<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">'第一种实现：'</span><span class="token punctuation">)</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>lis<span class="token punctuation">)</span>


lis<span class="token operator">=</span><span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">,</span><span class="token number">10</span><span class="token punctuation">,</span><span class="token number">100</span><span class="token punctuation">,</span><span class="token number">1000</span><span class="token punctuation">,</span><span class="token number">10000</span><span class="token punctuation">,</span><span class="token number">100000</span><span class="token punctuation">]</span>
<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">'第二种实现：'</span><span class="token punctuation">)</span>
lis<span class="token punctuation">.</span>reverse<span class="token punctuation">(</span><span class="token punctuation">)</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>lis<span class="token punctuation">)</span>

</code></pre>
<h4><a id="041_794"></a>实例041：类的方法与变量</h4>
<p><strong>题目</strong> 模仿静态变量的用法。</p>
<p><strong>程序分析</strong> 构造类，了解类的方法与变量。</p>
<pre><code class="prism language-python"><span class="token keyword">def</span> <span class="token function">dummy</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
    i<span class="token operator">=</span><span class="token number">0</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span>i<span class="token punctuation">)</span>
    i<span class="token operator">+=</span><span class="token number">1</span>

<span class="token keyword">class</span> <span class="token class-name">cls</span><span class="token punctuation">:</span>
    i<span class="token operator">=</span><span class="token number">0</span>
    <span class="token keyword">def</span> <span class="token function">dummy</span><span class="token punctuation">(</span>self<span class="token punctuation">)</span><span class="token punctuation">:</span>
        <span class="token keyword">print</span><span class="token punctuation">(</span>self<span class="token punctuation">.</span>i<span class="token punctuation">)</span>
        self<span class="token punctuation">.</span>i<span class="token operator">+=</span><span class="token number">1</span>

a<span class="token operator">=</span>cls<span class="token punctuation">(</span><span class="token punctuation">)</span>
<span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token number">50</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
    dummy<span class="token punctuation">(</span><span class="token punctuation">)</span>
    a<span class="token punctuation">.</span>dummy<span class="token punctuation">(</span><span class="token punctuation">)</span>
</code></pre>
<h4><a id="042_818"></a>实例042：变量作用域</h4>
<p><strong>题目</strong> 学习使用auto定义变量的用法。</p>
<p><strong>程序分析</strong> python中的变量作用域。</p>
<pre><code class="prism language-python">i<span class="token operator">=</span><span class="token number">0</span>
n<span class="token operator">=</span><span class="token number">0</span>
<span class="token keyword">def</span> <span class="token function">dummy</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
    i<span class="token operator">=</span><span class="token number">0</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span>i<span class="token punctuation">)</span>
    i<span class="token operator">+=</span><span class="token number">1</span>
<span class="token keyword">def</span> <span class="token function">dummy2</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
    <span class="token keyword">global</span> n
    <span class="token keyword">print</span><span class="token punctuation">(</span>n<span class="token punctuation">)</span>
    n<span class="token operator">+=</span><span class="token number">1</span>
<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">'函数内部的同名变量'</span><span class="token punctuation">)</span>
<span class="token keyword">for</span> j <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token number">20</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span>i<span class="token punctuation">)</span>
    dummy<span class="token punctuation">(</span><span class="token punctuation">)</span>
    i<span class="token operator">+=</span><span class="token number">1</span>
<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">'global声明同名变量'</span><span class="token punctuation">)</span>
<span class="token keyword">for</span> k <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token number">20</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span>n<span class="token punctuation">)</span>
    dummy2<span class="token punctuation">(</span><span class="token punctuation">)</span>
    n<span class="token operator">+=</span><span class="token number">10</span>
</code></pre>
<h4><a id="043_847"></a>实例043：作用域、类的方法与变量</h4>
<p><strong>题目</strong> 模仿静态变量(static)另一案例。</p>
<p><strong>程序分析</strong> 综合实例041和实例042。</p>
<pre><code class="prism language-python"><span class="token keyword">class</span> <span class="token class-name">dummy</span><span class="token punctuation">:</span>
    num<span class="token operator">=</span><span class="token number">1</span>
    <span class="token keyword">def</span> <span class="token function">Num</span><span class="token punctuation">(</span>self<span class="token punctuation">)</span><span class="token punctuation">:</span>
        <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">'class dummy num:'</span><span class="token punctuation">,</span>self<span class="token punctuation">.</span>num<span class="token punctuation">)</span>
        <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">'global num: '</span><span class="token punctuation">,</span>num<span class="token punctuation">)</span>
        self<span class="token punctuation">.</span>num<span class="token operator">+=</span><span class="token number">1</span>

n<span class="token operator">=</span>dummy<span class="token punctuation">(</span><span class="token punctuation">)</span>
num<span class="token operator">=</span><span class="token number">1</span>
<span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token number">5</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
    num<span class="token operator">*=</span><span class="token number">10</span>
    n<span class="token punctuation">.</span>Num<span class="token punctuation">(</span><span class="token punctuation">)</span>
</code></pre>
<h4><a id="044_868"></a>实例044：矩阵相加</h4>
<p><strong>题目</strong> 计算两个矩阵相加。</p>
<p><strong>程序分析</strong> 创建一个新的矩阵，使用 for 迭代并取出 X 和 Y 矩阵中对应位置的值，相加后放到新矩阵的对应位置中。</p>
<pre><code class="prism language-python">X <span class="token operator">=</span> <span class="token punctuation">[</span><span class="token punctuation">[</span><span class="token number">12</span><span class="token punctuation">,</span><span class="token number">7</span><span class="token punctuation">,</span><span class="token number">3</span><span class="token punctuation">]</span><span class="token punctuation">,</span>
    <span class="token punctuation">[</span><span class="token number">4</span> <span class="token punctuation">,</span><span class="token number">5</span><span class="token punctuation">,</span><span class="token number">6</span><span class="token punctuation">]</span><span class="token punctuation">,</span>
    <span class="token punctuation">[</span><span class="token number">7</span> <span class="token punctuation">,</span><span class="token number">8</span><span class="token punctuation">,</span><span class="token number">9</span><span class="token punctuation">]</span><span class="token punctuation">]</span>
 
Y <span class="token operator">=</span> <span class="token punctuation">[</span><span class="token punctuation">[</span><span class="token number">5</span><span class="token punctuation">,</span><span class="token number">8</span><span class="token punctuation">,</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">,</span>
    <span class="token punctuation">[</span><span class="token number">6</span><span class="token punctuation">,</span><span class="token number">7</span><span class="token punctuation">,</span><span class="token number">3</span><span class="token punctuation">]</span><span class="token punctuation">,</span>
    <span class="token punctuation">[</span><span class="token number">4</span><span class="token punctuation">,</span><span class="token number">5</span><span class="token punctuation">,</span><span class="token number">9</span><span class="token punctuation">]</span><span class="token punctuation">]</span>
 
res<span class="token operator">=</span><span class="token punctuation">[</span><span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">,</span>
    <span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">,</span>
    <span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">]</span>
<span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token builtin">len</span><span class="token punctuation">(</span>res<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
    <span class="token keyword">for</span> j <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token builtin">len</span><span class="token punctuation">(</span>res<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
        res<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">[</span>j<span class="token punctuation">]</span><span class="token operator">=</span>X<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">[</span>j<span class="token punctuation">]</span><span class="token operator">+</span>Y<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">[</span>j<span class="token punctuation">]</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>res<span class="token punctuation">)</span>

</code></pre>
<h4><a id="045_893"></a>实例045：求和</h4>
<p><strong>题目</strong> 统计 1 到 100 之和。</p>
<p><strong>程序分析</strong> 无</p>
<pre><code class="prism language-python">res<span class="token operator">=</span><span class="token number">0</span>
<span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token number">1</span><span class="token punctuation">,</span><span class="token number">101</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
    res<span class="token operator">+=</span>i
<span class="token keyword">print</span><span class="token punctuation">(</span>res<span class="token punctuation">)</span>
</code></pre>
<h4><a id="046_906"></a>实例046：打破循环</h4>
<p><strong>题目</strong> 求输入数字的平方，如果平方运算后小于 50 则退出。</p>
<p><strong>程序分析</strong> 无</p>
<pre><code class="prism language-python"><span class="token keyword">while</span> <span class="token boolean">True</span><span class="token punctuation">:</span>
    <span class="token keyword">try</span><span class="token punctuation">:</span>
        n<span class="token operator">=</span><span class="token builtin">float</span><span class="token punctuation">(</span><span class="token builtin">input</span><span class="token punctuation">(</span><span class="token string">'输入一个数字：'</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
    <span class="token keyword">except</span><span class="token punctuation">:</span>
        <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">'输入错误'</span><span class="token punctuation">)</span>
        <span class="token keyword">continue</span>
    dn<span class="token operator">=</span>n<span class="token operator">**</span><span class="token number">2</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">'其平方为：'</span><span class="token punctuation">,</span>dn<span class="token punctuation">)</span>
    <span class="token keyword">if</span> dn<span class="token operator">&lt;</span><span class="token number">50</span><span class="token punctuation">:</span>
        <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">'平方小于50，退出'</span><span class="token punctuation">)</span>
        <span class="token keyword">break</span>
</code></pre>
<h4><a id="047_926"></a>实例047：函数交换变量</h4>
<p><strong>题目</strong> 两个变量值用函数互换。</p>
<p><strong>程序分析</strong> 无</p>
<pre><code class="prism language-python"><span class="token keyword">def</span> <span class="token function">exc</span><span class="token punctuation">(</span>a<span class="token punctuation">,</span>b<span class="token punctuation">)</span><span class="token punctuation">:</span>
    <span class="token keyword">return</span> <span class="token punctuation">(</span>b<span class="token punctuation">,</span>a<span class="token punctuation">)</span>
a<span class="token operator">=</span><span class="token number">0</span>
b<span class="token operator">=</span><span class="token number">10</span>
a<span class="token punctuation">,</span>b<span class="token operator">=</span>exc<span class="token punctuation">(</span>a<span class="token punctuation">,</span>b<span class="token punctuation">)</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>a<span class="token punctuation">,</span>b<span class="token punctuation">)</span>
</code></pre>
<h4><a id="048_941"></a>实例048：数字比大小</h4>
<p><strong>题目</strong> 数字比较。</p>
<p><strong>程序分析</strong> 无</p>
<pre><code class="prism language-python">a<span class="token operator">=</span><span class="token builtin">int</span><span class="token punctuation">(</span><span class="token builtin">input</span><span class="token punctuation">(</span><span class="token string">'a='</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
b<span class="token operator">=</span><span class="token builtin">int</span><span class="token punctuation">(</span><span class="token builtin">input</span><span class="token punctuation">(</span><span class="token string">'b='</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
<span class="token keyword">if</span> a<span class="token operator">&lt;</span>b<span class="token punctuation">:</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">'a&lt;b'</span><span class="token punctuation">)</span>
<span class="token keyword">elif</span> a<span class="token operator">&gt;</span>b<span class="token punctuation">:</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">'a&gt;b'</span><span class="token punctuation">)</span>
<span class="token keyword">else</span><span class="token punctuation">:</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">'a=b'</span><span class="token punctuation">)</span>
</code></pre>
<h4><a id="049lambda_958"></a>实例049：lambda</h4>
<p><strong>题目</strong> 使用lambda来创建匿名函数。</p>
<p><strong>程序分析</strong> 无</p>
<pre><code class="prism language-python">Max<span class="token operator">=</span><span class="token keyword">lambda</span> x<span class="token punctuation">,</span>y<span class="token punctuation">:</span>x<span class="token operator">*</span><span class="token punctuation">(</span>x<span class="token operator">&gt;=</span>y<span class="token punctuation">)</span><span class="token operator">+</span>y<span class="token operator">*</span><span class="token punctuation">(</span>y<span class="token operator">&gt;</span>x<span class="token punctuation">)</span>
Min<span class="token operator">=</span><span class="token keyword">lambda</span> x<span class="token punctuation">,</span>y<span class="token punctuation">:</span>x<span class="token operator">*</span><span class="token punctuation">(</span>x<span class="token operator">&lt;=</span>y<span class="token punctuation">)</span><span class="token operator">+</span>y<span class="token operator">*</span><span class="token punctuation">(</span>y<span class="token operator">&lt;</span>x<span class="token punctuation">)</span>

a<span class="token operator">=</span><span class="token builtin">int</span><span class="token punctuation">(</span><span class="token builtin">input</span><span class="token punctuation">(</span><span class="token string">'1:'</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
b<span class="token operator">=</span><span class="token builtin">int</span><span class="token punctuation">(</span><span class="token builtin">input</span><span class="token punctuation">(</span><span class="token string">'2:'</span><span class="token punctuation">)</span><span class="token punctuation">)</span>

<span class="token keyword">print</span><span class="token punctuation">(</span>Max<span class="token punctuation">(</span>a<span class="token punctuation">,</span>b<span class="token punctuation">)</span><span class="token punctuation">)</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>Min<span class="token punctuation">(</span>a<span class="token punctuation">,</span>b<span class="token punctuation">)</span><span class="token punctuation">)</span>
</code></pre>
<h4><a id="050_975"></a>实例050：随机数</h4>
<p><strong>题目</strong> 输出一个随机数。</p>
<p><strong>程序分析</strong> 使用 random 模块。</p>
<pre><code class="prism language-python"><span class="token keyword">import</span> random
<span class="token keyword">print</span><span class="token punctuation">(</span>random<span class="token punctuation">.</span>uniform<span class="token punctuation">(</span><span class="token number">10</span><span class="token punctuation">,</span><span class="token number">20</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
</code></pre>
<h4><a id="051_986"></a>实例051：按位与</h4>
<p><strong>题目</strong> 学习使用按位与 &amp; 。</p>
<p><strong>程序分析</strong> 0&amp;0=0; 0&amp;1=0; 1&amp;0=0; 1&amp;1=1。</p>
<pre><code class="prism language-python">a<span class="token operator">=</span><span class="token number">0o77</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>a<span class="token punctuation">)</span>
b<span class="token operator">=</span>a<span class="token operator">&amp;</span><span class="token number">3</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>b<span class="token punctuation">)</span>
b<span class="token operator">=</span>b<span class="token operator">&amp;</span><span class="token number">7</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>b<span class="token punctuation">)</span>
</code></pre>
<h4><a id="052_1001"></a>实例052：按位或</h4>
<p><strong>题目</strong> 学习使用按位或 | 。</p>
<p><strong>程序分析</strong> 0|0=0; 0|1=1; 1|0=1; 1|1=1</p>
<pre><code class="prism language-python">a<span class="token operator">=</span><span class="token number">0o77</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>a<span class="token operator">|</span><span class="token number">3</span><span class="token punctuation">)</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>a<span class="token operator">|</span><span class="token number">3</span><span class="token operator">|</span><span class="token number">7</span><span class="token punctuation">)</span>
</code></pre>
<h4><a id="053_1013"></a>实例053：按位异或</h4>
<p><strong>题目</strong> 学习使用按位异或 ^ 。</p>
<p><strong>程序分析</strong> 0^0=0; 0^1=1; 1^0=1; 1^1=0</p>
<pre><code class="prism language-python">a<span class="token operator">=</span><span class="token number">0o77</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>a<span class="token operator">^</span><span class="token number">3</span><span class="token punctuation">)</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>a<span class="token operator">^</span><span class="token number">3</span><span class="token operator">^</span><span class="token number">7</span><span class="token punctuation">)</span>
</code></pre>
<h4><a id="054_1025"></a>实例054：位取反、位移动</h4>
<p><strong>题目</strong> 取一个整数a从右端开始的4〜7位。</p>
<p><strong>程序分析</strong> 可以这样考虑：<br>
(1)先使a右移4位。<br>
(2)设置一个低4位全为1,其余全为0的数。可用<sub>(</sub>0&lt;&lt;4)<br>
(3)将上面二者进行&amp;运算。</p>
<pre><code class="prism language-python">a<span class="token operator">=</span><span class="token builtin">int</span><span class="token punctuation">(</span><span class="token builtin">input</span><span class="token punctuation">(</span><span class="token string">'输入一个数字: '</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
b<span class="token operator">=</span><span class="token number">0</span>                 <span class="token comment">#     0</span>
b<span class="token operator">=</span><span class="token operator">~</span>b                <span class="token comment">#     1</span>
b<span class="token operator">=</span>b<span class="token operator">&lt;&lt;</span><span class="token number">4</span>              <span class="token comment"># 10000</span>
b<span class="token operator">=</span><span class="token operator">~</span>b                <span class="token comment">#  1111</span>
c<span class="token operator">=</span>a<span class="token operator">&gt;&gt;</span><span class="token number">4</span>
d<span class="token operator">=</span>c<span class="token operator">&amp;</span>b
<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">'a:'</span><span class="token punctuation">,</span><span class="token builtin">bin</span><span class="token punctuation">(</span>a<span class="token punctuation">)</span><span class="token punctuation">)</span>
<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">'b:'</span><span class="token punctuation">,</span><span class="token builtin">bin</span><span class="token punctuation">(</span>b<span class="token punctuation">)</span><span class="token punctuation">)</span>
<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">'c:'</span><span class="token punctuation">,</span><span class="token builtin">bin</span><span class="token punctuation">(</span>c<span class="token punctuation">)</span><span class="token punctuation">)</span>
<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">'d:'</span><span class="token punctuation">,</span><span class="token builtin">bin</span><span class="token punctuation">(</span>d<span class="token punctuation">)</span><span class="token punctuation">)</span>
</code></pre>
<h4><a id="055_1048"></a>实例055：按位取反</h4>
<p><strong>题目</strong> 学习使用按位取反~。</p>
<p><strong>程序分析</strong> ~0=1; ~1=0;</p>
<pre><code class="prism language-python"><span class="token keyword">print</span><span class="token punctuation">(</span><span class="token operator">~</span><span class="token number">234</span><span class="token punctuation">)</span>
<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token operator">~</span><span class="token operator">~</span><span class="token number">234</span><span class="token punctuation">)</span>
</code></pre>
<h4><a id="056_1059"></a>实例056：画圈</h4>
<p><strong>题目</strong> 画图，学用circle画圆形。</p>
<p><strong>程序分析</strong> 无。</p>
<pre><code class="prism language-python"><span class="token keyword">from</span> tkinter <span class="token keyword">import</span> <span class="token operator">*</span>
canvas<span class="token operator">=</span>Canvas<span class="token punctuation">(</span>width<span class="token operator">=</span><span class="token number">800</span><span class="token punctuation">,</span>height<span class="token operator">=</span><span class="token number">600</span><span class="token punctuation">,</span>bg<span class="token operator">=</span><span class="token string">'yellow'</span><span class="token punctuation">)</span>
canvas<span class="token punctuation">.</span>pack<span class="token punctuation">(</span>expand<span class="token operator">=</span>YES<span class="token punctuation">,</span>fill<span class="token operator">=</span>BOTH<span class="token punctuation">)</span>
k<span class="token operator">=</span><span class="token number">1</span>
j<span class="token operator">=</span><span class="token number">1</span>
<span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token number">26</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
    canvas<span class="token punctuation">.</span>create_oval<span class="token punctuation">(</span><span class="token number">310</span><span class="token operator">-</span>k<span class="token punctuation">,</span><span class="token number">250</span><span class="token operator">-</span>k<span class="token punctuation">,</span><span class="token number">310</span><span class="token operator">+</span>k<span class="token punctuation">,</span><span class="token number">250</span><span class="token operator">+</span>k<span class="token punctuation">,</span>width<span class="token operator">=</span><span class="token number">1</span><span class="token punctuation">)</span>
    k<span class="token operator">+=</span>j
    j<span class="token operator">+=</span><span class="token number">0.3</span>
mainloop<span class="token punctuation">(</span><span class="token punctuation">)</span>
</code></pre>
<h4><a id="057_1078"></a>实例057：画线</h4>
<p><strong>题目</strong> 画图，学用line画直线。</p>
<p><strong>程序分析</strong> 无。</p>
<pre><code class="prism language-python"><span class="token keyword">if</span> __name__ <span class="token operator">==</span> <span class="token string">'__main__'</span><span class="token punctuation">:</span>
    <span class="token keyword">from</span> tkinter <span class="token keyword">import</span> <span class="token operator">*</span>
 
    canvas <span class="token operator">=</span> Canvas<span class="token punctuation">(</span>width<span class="token operator">=</span><span class="token number">300</span><span class="token punctuation">,</span> height<span class="token operator">=</span><span class="token number">300</span><span class="token punctuation">,</span> bg<span class="token operator">=</span><span class="token string">'green'</span><span class="token punctuation">)</span>   
    canvas<span class="token punctuation">.</span>pack<span class="token punctuation">(</span>expand<span class="token operator">=</span>YES<span class="token punctuation">,</span> fill<span class="token operator">=</span>BOTH<span class="token punctuation">)</span>                  
    x0 <span class="token operator">=</span> <span class="token number">263</span>
    y0 <span class="token operator">=</span> <span class="token number">263</span>
    y1 <span class="token operator">=</span> <span class="token number">275</span>
    x1 <span class="token operator">=</span> <span class="token number">275</span>
    <span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token number">19</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
        canvas<span class="token punctuation">.</span>create_line<span class="token punctuation">(</span>x0<span class="token punctuation">,</span>y0<span class="token punctuation">,</span>x0<span class="token punctuation">,</span>y1<span class="token punctuation">,</span> width<span class="token operator">=</span><span class="token number">1</span><span class="token punctuation">,</span> fill<span class="token operator">=</span><span class="token string">'red'</span><span class="token punctuation">)</span>
        x0 <span class="token operator">=</span> x0 <span class="token operator">-</span> <span class="token number">5</span>
        y0 <span class="token operator">=</span> y0 <span class="token operator">-</span> <span class="token number">5</span>
        x1 <span class="token operator">=</span> x1 <span class="token operator">+</span> <span class="token number">5</span>
        y1 <span class="token operator">=</span> y1 <span class="token operator">+</span> <span class="token number">5</span>
 
    x0 <span class="token operator">=</span> <span class="token number">263</span>
    y1 <span class="token operator">=</span> <span class="token number">275</span>
    y0 <span class="token operator">=</span> <span class="token number">263</span>
    <span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token number">21</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
        canvas<span class="token punctuation">.</span>create_line<span class="token punctuation">(</span>x0<span class="token punctuation">,</span>y0<span class="token punctuation">,</span>x0<span class="token punctuation">,</span>y1<span class="token punctuation">,</span>fill <span class="token operator">=</span> <span class="token string">'red'</span><span class="token punctuation">)</span>
        x0 <span class="token operator">+=</span> <span class="token number">5</span>
        y0 <span class="token operator">+=</span> <span class="token number">5</span>
        y1 <span class="token operator">+=</span> <span class="token number">5</span>
 
    mainloop<span class="token punctuation">(</span><span class="token punctuation">)</span>
</code></pre>
<h4><a id="058_1113"></a>实例058：画矩形</h4>
<p><strong>题目</strong> 画图，学用rectangle画方形。</p>
<p><strong>程序分析</strong> 无。</p>
<pre><code class="prism language-python"><span class="token keyword">if</span> __name__ <span class="token operator">==</span> <span class="token string">'__main__'</span><span class="token punctuation">:</span>
    <span class="token keyword">from</span> tkinter <span class="token keyword">import</span> <span class="token operator">*</span>
    root <span class="token operator">=</span> Tk<span class="token punctuation">(</span><span class="token punctuation">)</span>
    root<span class="token punctuation">.</span>title<span class="token punctuation">(</span><span class="token string">'Canvas'</span><span class="token punctuation">)</span>
    canvas <span class="token operator">=</span> Canvas<span class="token punctuation">(</span>root<span class="token punctuation">,</span>width <span class="token operator">=</span> <span class="token number">400</span><span class="token punctuation">,</span>height <span class="token operator">=</span> <span class="token number">400</span><span class="token punctuation">,</span>bg <span class="token operator">=</span> <span class="token string">'yellow'</span><span class="token punctuation">)</span>
    x0 <span class="token operator">=</span> <span class="token number">263</span>
    y0 <span class="token operator">=</span> <span class="token number">263</span>
    y1 <span class="token operator">=</span> <span class="token number">275</span>
    x1 <span class="token operator">=</span> <span class="token number">275</span>
    <span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token number">19</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
        canvas<span class="token punctuation">.</span>create_rectangle<span class="token punctuation">(</span>x0<span class="token punctuation">,</span>y0<span class="token punctuation">,</span>x1<span class="token punctuation">,</span>y1<span class="token punctuation">)</span>
        x0 <span class="token operator">-=</span> <span class="token number">5</span>
        y0 <span class="token operator">-=</span> <span class="token number">5</span>
        x1 <span class="token operator">+=</span> <span class="token number">5</span>
        y1 <span class="token operator">+=</span> <span class="token number">5</span>
        
    canvas<span class="token punctuation">.</span>pack<span class="token punctuation">(</span><span class="token punctuation">)</span>
    root<span class="token punctuation">.</span>mainloop<span class="token punctuation">(</span><span class="token punctuation">)</span>
</code></pre>
<h4><a id="059_1140"></a>实例059：画图（丑）</h4>
<p><strong>题目</strong> 画图，综合例子。</p>
<p><strong>程序分析</strong> 丑。</p>
<pre><code class="prism language-python"><span class="token keyword">if</span> __name__  <span class="token operator">==</span> <span class="token string">'__main__'</span><span class="token punctuation">:</span>
    <span class="token keyword">from</span> tkinter <span class="token keyword">import</span> <span class="token operator">*</span>
    canvas <span class="token operator">=</span> Canvas<span class="token punctuation">(</span>width <span class="token operator">=</span> <span class="token number">300</span><span class="token punctuation">,</span>height <span class="token operator">=</span> <span class="token number">300</span><span class="token punctuation">,</span>bg <span class="token operator">=</span> <span class="token string">'green'</span><span class="token punctuation">)</span>
    canvas<span class="token punctuation">.</span>pack<span class="token punctuation">(</span>expand <span class="token operator">=</span> YES<span class="token punctuation">,</span>fill <span class="token operator">=</span> BOTH<span class="token punctuation">)</span>
    x0 <span class="token operator">=</span> <span class="token number">150</span>
    y0 <span class="token operator">=</span> <span class="token number">100</span>
    canvas<span class="token punctuation">.</span>create_oval<span class="token punctuation">(</span>x0 <span class="token operator">-</span> <span class="token number">10</span><span class="token punctuation">,</span>y0 <span class="token operator">-</span> <span class="token number">10</span><span class="token punctuation">,</span>x0 <span class="token operator">+</span> <span class="token number">10</span><span class="token punctuation">,</span>y0 <span class="token operator">+</span> <span class="token number">10</span><span class="token punctuation">)</span>
    canvas<span class="token punctuation">.</span>create_oval<span class="token punctuation">(</span>x0 <span class="token operator">-</span> <span class="token number">20</span><span class="token punctuation">,</span>y0 <span class="token operator">-</span> <span class="token number">20</span><span class="token punctuation">,</span>x0 <span class="token operator">+</span> <span class="token number">20</span><span class="token punctuation">,</span>y0 <span class="token operator">+</span> <span class="token number">20</span><span class="token punctuation">)</span>
    canvas<span class="token punctuation">.</span>create_oval<span class="token punctuation">(</span>x0 <span class="token operator">-</span> <span class="token number">50</span><span class="token punctuation">,</span>y0 <span class="token operator">-</span> <span class="token number">50</span><span class="token punctuation">,</span>x0 <span class="token operator">+</span> <span class="token number">50</span><span class="token punctuation">,</span>y0 <span class="token operator">+</span> <span class="token number">50</span><span class="token punctuation">)</span>
    <span class="token keyword">import</span> math
    B <span class="token operator">=</span> <span class="token number">0.809</span>
    <span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token number">16</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
        a <span class="token operator">=</span> <span class="token number">2</span> <span class="token operator">*</span> math<span class="token punctuation">.</span>pi <span class="token operator">/</span> <span class="token number">16</span> <span class="token operator">*</span> i
        x <span class="token operator">=</span> math<span class="token punctuation">.</span>ceil<span class="token punctuation">(</span>x0 <span class="token operator">+</span> <span class="token number">48</span> <span class="token operator">*</span> math<span class="token punctuation">.</span>cos<span class="token punctuation">(</span>a<span class="token punctuation">)</span><span class="token punctuation">)</span>
        y <span class="token operator">=</span> math<span class="token punctuation">.</span>ceil<span class="token punctuation">(</span>y0 <span class="token operator">+</span> <span class="token number">48</span> <span class="token operator">*</span> math<span class="token punctuation">.</span>sin<span class="token punctuation">(</span>a<span class="token punctuation">)</span> <span class="token operator">*</span> B<span class="token punctuation">)</span>
        canvas<span class="token punctuation">.</span>create_line<span class="token punctuation">(</span>x0<span class="token punctuation">,</span>y0<span class="token punctuation">,</span>x<span class="token punctuation">,</span>y<span class="token punctuation">,</span>fill <span class="token operator">=</span> <span class="token string">'red'</span><span class="token punctuation">)</span>
    canvas<span class="token punctuation">.</span>create_oval<span class="token punctuation">(</span>x0 <span class="token operator">-</span> <span class="token number">60</span><span class="token punctuation">,</span>y0 <span class="token operator">-</span> <span class="token number">60</span><span class="token punctuation">,</span>x0 <span class="token operator">+</span> <span class="token number">60</span><span class="token punctuation">,</span>y0 <span class="token operator">+</span> <span class="token number">60</span><span class="token punctuation">)</span>
    

    <span class="token keyword">for</span> k <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token number">501</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
        <span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token number">17</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
            a <span class="token operator">=</span> <span class="token punctuation">(</span><span class="token number">2</span> <span class="token operator">*</span> math<span class="token punctuation">.</span>pi <span class="token operator">/</span> <span class="token number">16</span><span class="token punctuation">)</span> <span class="token operator">*</span> i <span class="token operator">+</span> <span class="token punctuation">(</span><span class="token number">2</span> <span class="token operator">*</span> math<span class="token punctuation">.</span>pi <span class="token operator">/</span> <span class="token number">180</span><span class="token punctuation">)</span> <span class="token operator">*</span> k
            x <span class="token operator">=</span> math<span class="token punctuation">.</span>ceil<span class="token punctuation">(</span>x0 <span class="token operator">+</span> <span class="token number">48</span> <span class="token operator">*</span> math<span class="token punctuation">.</span>cos<span class="token punctuation">(</span>a<span class="token punctuation">)</span><span class="token punctuation">)</span>
            y <span class="token operator">=</span> math<span class="token punctuation">.</span>ceil<span class="token punctuation">(</span>y0 <span class="token operator">+</span> <span class="token number">48</span> <span class="token operator">+</span> math<span class="token punctuation">.</span>sin<span class="token punctuation">(</span>a<span class="token punctuation">)</span> <span class="token operator">*</span> B<span class="token punctuation">)</span>
            canvas<span class="token punctuation">.</span>create_line<span class="token punctuation">(</span>x0<span class="token punctuation">,</span>y0<span class="token punctuation">,</span>x<span class="token punctuation">,</span>y<span class="token punctuation">,</span>fill <span class="token operator">=</span> <span class="token string">'red'</span><span class="token punctuation">)</span>
        <span class="token keyword">for</span> j <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token number">51</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
            a <span class="token operator">=</span> <span class="token punctuation">(</span><span class="token number">2</span> <span class="token operator">*</span> math<span class="token punctuation">.</span>pi <span class="token operator">/</span> <span class="token number">16</span><span class="token punctuation">)</span> <span class="token operator">*</span> i <span class="token operator">+</span> <span class="token punctuation">(</span><span class="token number">2</span><span class="token operator">*</span> math<span class="token punctuation">.</span>pi <span class="token operator">/</span> <span class="token number">180</span><span class="token punctuation">)</span> <span class="token operator">*</span> k <span class="token operator">-</span> <span class="token number">1</span>
            x <span class="token operator">=</span> math<span class="token punctuation">.</span>ceil<span class="token punctuation">(</span>x0 <span class="token operator">+</span> <span class="token number">48</span> <span class="token operator">*</span> math<span class="token punctuation">.</span>cos<span class="token punctuation">(</span>a<span class="token punctuation">)</span><span class="token punctuation">)</span>
            y <span class="token operator">=</span> math<span class="token punctuation">.</span>ceil<span class="token punctuation">(</span>y0 <span class="token operator">+</span> <span class="token number">48</span> <span class="token operator">*</span> math<span class="token punctuation">.</span>sin<span class="token punctuation">(</span>a<span class="token punctuation">)</span> <span class="token operator">*</span> B<span class="token punctuation">)</span>
            canvas<span class="token punctuation">.</span>create_line<span class="token punctuation">(</span>x0<span class="token punctuation">,</span>y0<span class="token punctuation">,</span>x<span class="token punctuation">,</span>y<span class="token punctuation">,</span>fill <span class="token operator">=</span> <span class="token string">'red'</span><span class="token punctuation">)</span>
    mainloop<span class="token punctuation">(</span><span class="token punctuation">)</span>
</code></pre>
<h4><a id="060_1180"></a>实例060：字符串长度</h4>
<p><strong>题目</strong> 计算字符串长度。</p>
<p><strong>程序分析</strong> 无。</p>
<pre><code class="prism language-python">s<span class="token operator">=</span><span class="token string">'zhangguang101'</span>
<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token builtin">len</span><span class="token punctuation">(</span>s<span class="token punctuation">)</span><span class="token punctuation">)</span>
</code></pre>
<h4><a id="061_1191"></a>实例061：杨辉三角</h4>
<p><strong>题目</strong> 打印出杨辉三角形前十行。</p>
<p><strong>程序分析</strong> 无。</p>
<pre><code class="prism language-python"><span class="token keyword">def</span> <span class="token function">generate</span><span class="token punctuation">(</span>numRows<span class="token punctuation">)</span><span class="token punctuation">:</span>
    r <span class="token operator">=</span> <span class="token punctuation">[</span><span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">]</span>
    <span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token number">1</span><span class="token punctuation">,</span>numRows<span class="token punctuation">)</span><span class="token punctuation">:</span>
        r<span class="token punctuation">.</span>append<span class="token punctuation">(</span><span class="token builtin">list</span><span class="token punctuation">(</span><span class="token builtin">map</span><span class="token punctuation">(</span><span class="token keyword">lambda</span> x<span class="token punctuation">,</span>y<span class="token punctuation">:</span>x<span class="token operator">+</span>y<span class="token punctuation">,</span> <span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token operator">+</span>r<span class="token punctuation">[</span><span class="token operator">-</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">,</span>r<span class="token punctuation">[</span><span class="token operator">-</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token operator">+</span><span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
    <span class="token keyword">return</span> r<span class="token punctuation">[</span><span class="token punctuation">:</span>numRows<span class="token punctuation">]</span>
a<span class="token operator">=</span>generate<span class="token punctuation">(</span><span class="token number">10</span><span class="token punctuation">)</span>
<span class="token keyword">for</span> i <span class="token keyword">in</span> a<span class="token punctuation">:</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span>i<span class="token punctuation">)</span>
</code></pre>
<h4><a id="062_1208"></a>实例062：查找字符串</h4>
<p><strong>题目</strong> 查找字符串。</p>
<p><strong>程序分析</strong> 无。</p>
<pre><code class="prism language-python">s1<span class="token operator">=</span><span class="token string">'aabbxuebixuebi'</span>
s2<span class="token operator">=</span><span class="token string">'ab'</span>
s3<span class="token operator">=</span><span class="token string">'xue'</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>s1<span class="token punctuation">.</span>find<span class="token punctuation">(</span>s2<span class="token punctuation">)</span><span class="token punctuation">)</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>s1<span class="token punctuation">.</span>find<span class="token punctuation">(</span>s3<span class="token punctuation">)</span><span class="token punctuation">)</span>
</code></pre>
<h4><a id="063_1222"></a>实例063：画椭圆</h4>
<p><strong>题目</strong> 画椭圆。</p>
<p><strong>程序分析</strong> 使用 tkinter。</p>
<pre><code class="prism language-python"><span class="token keyword">if</span> __name__ <span class="token operator">==</span> <span class="token string">'__main__'</span><span class="token punctuation">:</span>
    <span class="token keyword">from</span> tkinter <span class="token keyword">import</span> <span class="token operator">*</span>
    x <span class="token operator">=</span> <span class="token number">360</span>
    y <span class="token operator">=</span> <span class="token number">160</span>
    top <span class="token operator">=</span> y <span class="token operator">-</span> <span class="token number">30</span>
    bottom <span class="token operator">=</span> y <span class="token operator">-</span> <span class="token number">30</span>
    
    canvas <span class="token operator">=</span> Canvas<span class="token punctuation">(</span>width <span class="token operator">=</span> <span class="token number">400</span><span class="token punctuation">,</span>height <span class="token operator">=</span> <span class="token number">600</span><span class="token punctuation">,</span>bg <span class="token operator">=</span> <span class="token string">'white'</span><span class="token punctuation">)</span>
    <span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token number">20</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
        canvas<span class="token punctuation">.</span>create_oval<span class="token punctuation">(</span><span class="token number">250</span> <span class="token operator">-</span> top<span class="token punctuation">,</span><span class="token number">250</span> <span class="token operator">-</span> bottom<span class="token punctuation">,</span><span class="token number">250</span> <span class="token operator">+</span> top<span class="token punctuation">,</span><span class="token number">250</span> <span class="token operator">+</span> bottom<span class="token punctuation">)</span>
        top <span class="token operator">-=</span> <span class="token number">5</span>
        bottom <span class="token operator">+=</span> <span class="token number">5</span>
    canvas<span class="token punctuation">.</span>pack<span class="token punctuation">(</span><span class="token punctuation">)</span>
    mainloop<span class="token punctuation">(</span><span class="token punctuation">)</span>
</code></pre>
<h4><a id="064_1245"></a>实例064：画椭圆、矩形</h4>
<p><strong>题目</strong> 利用ellipse 和 rectangle 画图。。</p>
<p><strong>程序分析</strong> 无。</p>
<pre><code class="prism language-python"><span class="token keyword">if</span> __name__ <span class="token operator">==</span> <span class="token string">'__main__'</span><span class="token punctuation">:</span>
    <span class="token keyword">from</span> tkinter <span class="token keyword">import</span> <span class="token operator">*</span>
    canvas <span class="token operator">=</span> Canvas<span class="token punctuation">(</span>width <span class="token operator">=</span> <span class="token number">400</span><span class="token punctuation">,</span>height <span class="token operator">=</span> <span class="token number">600</span><span class="token punctuation">,</span>bg <span class="token operator">=</span> <span class="token string">'white'</span><span class="token punctuation">)</span>
    left <span class="token operator">=</span> <span class="token number">20</span>
    right <span class="token operator">=</span> <span class="token number">50</span>
    top <span class="token operator">=</span> <span class="token number">50</span>
    num <span class="token operator">=</span> <span class="token number">15</span>
    <span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span>num<span class="token punctuation">)</span><span class="token punctuation">:</span>
        canvas<span class="token punctuation">.</span>create_oval<span class="token punctuation">(</span><span class="token number">250</span> <span class="token operator">-</span> right<span class="token punctuation">,</span><span class="token number">250</span> <span class="token operator">-</span> left<span class="token punctuation">,</span><span class="token number">250</span> <span class="token operator">+</span> right<span class="token punctuation">,</span><span class="token number">250</span> <span class="token operator">+</span> left<span class="token punctuation">)</span>
        canvas<span class="token punctuation">.</span>create_oval<span class="token punctuation">(</span><span class="token number">250</span> <span class="token operator">-</span> <span class="token number">20</span><span class="token punctuation">,</span><span class="token number">250</span> <span class="token operator">-</span> top<span class="token punctuation">,</span><span class="token number">250</span> <span class="token operator">+</span> <span class="token number">20</span><span class="token punctuation">,</span><span class="token number">250</span> <span class="token operator">+</span> top<span class="token punctuation">)</span>
        canvas<span class="token punctuation">.</span>create_rectangle<span class="token punctuation">(</span><span class="token number">20</span> <span class="token operator">-</span> <span class="token number">2</span> <span class="token operator">*</span> i<span class="token punctuation">,</span><span class="token number">20</span> <span class="token operator">-</span> <span class="token number">2</span> <span class="token operator">*</span> i<span class="token punctuation">,</span><span class="token number">10</span> <span class="token operator">*</span> <span class="token punctuation">(</span>i <span class="token operator">+</span> <span class="token number">2</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token number">10</span> <span class="token operator">*</span> <span class="token punctuation">(</span> i <span class="token operator">+</span> <span class="token number">2</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
        right <span class="token operator">+=</span> <span class="token number">5</span>
        left <span class="token operator">+=</span> <span class="token number">5</span>
        top <span class="token operator">+=</span> <span class="token number">10</span>

    canvas<span class="token punctuation">.</span>pack<span class="token punctuation">(</span><span class="token punctuation">)</span>
    mainloop<span class="token punctuation">(</span><span class="token punctuation">)</span>
</code></pre>
<h4><a id="065_1271"></a>实例065：画组合图形</h4>
<p><strong>题目</strong> 一个最优美的图案。</p>
<p><strong>程序分析</strong> 无。</p>
<pre><code class="prism language-python"><span class="token keyword">import</span> math
<span class="token keyword">from</span> tkinter <span class="token keyword">import</span> <span class="token operator">*</span>

<span class="token keyword">class</span> <span class="token class-name">PTS</span><span class="token punctuation">:</span>
    <span class="token keyword">def</span> <span class="token function">__init__</span><span class="token punctuation">(</span>self<span class="token punctuation">)</span><span class="token punctuation">:</span>
        self<span class="token punctuation">.</span>x <span class="token operator">=</span> <span class="token number">0</span>
        self<span class="token punctuation">.</span>y <span class="token operator">=</span> <span class="token number">0</span>
points <span class="token operator">=</span> <span class="token punctuation">[</span><span class="token punctuation">]</span>

<span class="token keyword">def</span> <span class="token function">LineToDemo</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
    screenx <span class="token operator">=</span> <span class="token number">400</span>
    screeny <span class="token operator">=</span> <span class="token number">400</span>
    canvas <span class="token operator">=</span> Canvas<span class="token punctuation">(</span>width <span class="token operator">=</span> screenx<span class="token punctuation">,</span>height <span class="token operator">=</span> screeny<span class="token punctuation">,</span>bg <span class="token operator">=</span> <span class="token string">'white'</span><span class="token punctuation">)</span>

    AspectRatio <span class="token operator">=</span> <span class="token number">0.85</span>
    MAXPTS <span class="token operator">=</span> <span class="token number">15</span>
    h <span class="token operator">=</span> screeny
    w <span class="token operator">=</span> screenx
    xcenter <span class="token operator">=</span> w <span class="token operator">/</span> <span class="token number">2</span>
    ycenter <span class="token operator">=</span> h <span class="token operator">/</span> <span class="token number">2</span>
    radius <span class="token operator">=</span> <span class="token punctuation">(</span>h <span class="token operator">-</span> <span class="token number">30</span><span class="token punctuation">)</span> <span class="token operator">/</span> <span class="token punctuation">(</span>AspectRatio <span class="token operator">*</span> <span class="token number">2</span><span class="token punctuation">)</span> <span class="token operator">-</span> <span class="token number">20</span>
    step <span class="token operator">=</span> <span class="token number">360</span> <span class="token operator">/</span> MAXPTS
    angle <span class="token operator">=</span> <span class="token number">0.0</span>
    <span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span>MAXPTS<span class="token punctuation">)</span><span class="token punctuation">:</span>
        rads <span class="token operator">=</span> angle <span class="token operator">*</span> math<span class="token punctuation">.</span>pi <span class="token operator">/</span> <span class="token number">180.0</span>
        p <span class="token operator">=</span> PTS<span class="token punctuation">(</span><span class="token punctuation">)</span>
        p<span class="token punctuation">.</span>x <span class="token operator">=</span> xcenter <span class="token operator">+</span> <span class="token builtin">int</span><span class="token punctuation">(</span>math<span class="token punctuation">.</span>cos<span class="token punctuation">(</span>rads<span class="token punctuation">)</span> <span class="token operator">*</span> radius<span class="token punctuation">)</span>
        p<span class="token punctuation">.</span>y <span class="token operator">=</span> ycenter <span class="token operator">-</span> <span class="token builtin">int</span><span class="token punctuation">(</span>math<span class="token punctuation">.</span>sin<span class="token punctuation">(</span>rads<span class="token punctuation">)</span> <span class="token operator">*</span> radius <span class="token operator">*</span> AspectRatio<span class="token punctuation">)</span>
        angle <span class="token operator">+=</span> step
        points<span class="token punctuation">.</span>append<span class="token punctuation">(</span>p<span class="token punctuation">)</span>
    canvas<span class="token punctuation">.</span>create_oval<span class="token punctuation">(</span>xcenter <span class="token operator">-</span> radius<span class="token punctuation">,</span>ycenter <span class="token operator">-</span> radius<span class="token punctuation">,</span>
                       xcenter <span class="token operator">+</span> radius<span class="token punctuation">,</span>ycenter <span class="token operator">+</span> radius<span class="token punctuation">)</span>
    <span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span>MAXPTS<span class="token punctuation">)</span><span class="token punctuation">:</span>
        <span class="token keyword">for</span> j <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span>i<span class="token punctuation">,</span>MAXPTS<span class="token punctuation">)</span><span class="token punctuation">:</span>
            canvas<span class="token punctuation">.</span>create_line<span class="token punctuation">(</span>points<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">.</span>x<span class="token punctuation">,</span>points<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">.</span>y<span class="token punctuation">,</span>points<span class="token punctuation">[</span>j<span class="token punctuation">]</span><span class="token punctuation">.</span>x<span class="token punctuation">,</span>points<span class="token punctuation">[</span>j<span class="token punctuation">]</span><span class="token punctuation">.</span>y<span class="token punctuation">)</span>

    canvas<span class="token punctuation">.</span>pack<span class="token punctuation">(</span><span class="token punctuation">)</span>
    mainloop<span class="token punctuation">(</span><span class="token punctuation">)</span>
<span class="token keyword">if</span> __name__ <span class="token operator">==</span> <span class="token string">'__main__'</span><span class="token punctuation">:</span>
    LineToDemo<span class="token punctuation">(</span><span class="token punctuation">)</span>
</code></pre>
<h4><a id="066_1320"></a>实例066：三数排序</h4>
<p><strong>题目</strong> 输入3个数a,b,c，按大小顺序输出。</p>
<p><strong>程序分析</strong> 同实例005。</p>
<pre><code class="prism language-python">raw<span class="token operator">=</span><span class="token punctuation">[</span><span class="token punctuation">]</span>
<span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token number">3</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
    x<span class="token operator">=</span><span class="token builtin">int</span><span class="token punctuation">(</span><span class="token builtin">input</span><span class="token punctuation">(</span><span class="token string">'int%d: '</span><span class="token operator">%</span><span class="token punctuation">(</span>i<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
    raw<span class="token punctuation">.</span>append<span class="token punctuation">(</span>x<span class="token punctuation">)</span>
    
<span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token builtin">len</span><span class="token punctuation">(</span>raw<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
    <span class="token keyword">for</span> j <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span>i<span class="token punctuation">,</span><span class="token builtin">len</span><span class="token punctuation">(</span>raw<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
        <span class="token keyword">if</span> raw<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token operator">&gt;</span>raw<span class="token punctuation">[</span>j<span class="token punctuation">]</span><span class="token punctuation">:</span>
            raw<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">,</span>raw<span class="token punctuation">[</span>j<span class="token punctuation">]</span><span class="token operator">=</span>raw<span class="token punctuation">[</span>j<span class="token punctuation">]</span><span class="token punctuation">,</span>raw<span class="token punctuation">[</span>i<span class="token punctuation">]</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>raw<span class="token punctuation">)</span>


raw2<span class="token operator">=</span><span class="token punctuation">[</span><span class="token punctuation">]</span>
<span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token number">3</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
    x<span class="token operator">=</span><span class="token builtin">int</span><span class="token punctuation">(</span><span class="token builtin">input</span><span class="token punctuation">(</span><span class="token string">'int%d: '</span><span class="token operator">%</span><span class="token punctuation">(</span>i<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
    raw2<span class="token punctuation">.</span>append<span class="token punctuation">(</span>x<span class="token punctuation">)</span>
<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token builtin">sorted</span><span class="token punctuation">(</span>raw2<span class="token punctuation">)</span><span class="token punctuation">)</span>

</code></pre>
<h4><a id="067_1347"></a>实例067：交换位置</h4>
<p><strong>题目</strong> 输入数组，最大的与第一个元素交换，最小的与最后一个元素交换，输出数组。</p>
<p><strong>程序分析</strong> 无。</p>
<pre><code class="prism language-python">li<span class="token operator">=</span><span class="token punctuation">[</span><span class="token number">3</span><span class="token punctuation">,</span><span class="token number">2</span><span class="token punctuation">,</span><span class="token number">5</span><span class="token punctuation">,</span><span class="token number">7</span><span class="token punctuation">,</span><span class="token number">8</span><span class="token punctuation">,</span><span class="token number">1</span><span class="token punctuation">,</span><span class="token number">5</span><span class="token punctuation">]</span>

li<span class="token punctuation">[</span><span class="token operator">-</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">,</span>li<span class="token punctuation">[</span>li<span class="token punctuation">.</span>index<span class="token punctuation">(</span><span class="token builtin">min</span><span class="token punctuation">(</span>li<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">]</span><span class="token operator">=</span>li<span class="token punctuation">[</span>li<span class="token punctuation">.</span>index<span class="token punctuation">(</span><span class="token builtin">min</span><span class="token punctuation">(</span>li<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">]</span><span class="token punctuation">,</span>li<span class="token punctuation">[</span><span class="token operator">-</span><span class="token number">1</span><span class="token punctuation">]</span>

m<span class="token operator">=</span>li<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span>
ind<span class="token operator">=</span>li<span class="token punctuation">.</span>index<span class="token punctuation">(</span><span class="token builtin">max</span><span class="token punctuation">(</span>li<span class="token punctuation">)</span><span class="token punctuation">)</span>
li<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token operator">=</span>li<span class="token punctuation">[</span>ind<span class="token punctuation">]</span>
li<span class="token punctuation">[</span>ind<span class="token punctuation">]</span><span class="token operator">=</span>m

<span class="token keyword">print</span><span class="token punctuation">(</span>li<span class="token punctuation">)</span>
</code></pre>
<h4><a id="068_1366"></a>实例068：旋转数列</h4>
<p><strong>题目</strong> 有n个整数，使其前面各数顺序向后移m个位置，最后m个数变成最前面的m个数</p>
<p><strong>程序分析</strong> 无。</p>
<pre><code class="prism language-python"><span class="token keyword">from</span> collections <span class="token keyword">import</span> <span class="token operator">*</span>
li<span class="token operator">=</span><span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">,</span><span class="token number">2</span><span class="token punctuation">,</span><span class="token number">3</span><span class="token punctuation">,</span><span class="token number">4</span><span class="token punctuation">,</span><span class="token number">5</span><span class="token punctuation">,</span><span class="token number">6</span><span class="token punctuation">,</span><span class="token number">7</span><span class="token punctuation">,</span><span class="token number">8</span><span class="token punctuation">,</span><span class="token number">9</span><span class="token punctuation">]</span>
deq<span class="token operator">=</span>deque<span class="token punctuation">(</span>li<span class="token punctuation">,</span>maxlen<span class="token operator">=</span><span class="token builtin">len</span><span class="token punctuation">(</span>li<span class="token punctuation">)</span><span class="token punctuation">)</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>li<span class="token punctuation">)</span>
deq<span class="token punctuation">.</span>rotate<span class="token punctuation">(</span><span class="token builtin">int</span><span class="token punctuation">(</span><span class="token builtin">input</span><span class="token punctuation">(</span><span class="token string">'rotate:'</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token builtin">list</span><span class="token punctuation">(</span>deq<span class="token punctuation">)</span><span class="token punctuation">)</span>
</code></pre>
<h4><a id="069_1381"></a>实例069：报数</h4>
<p><strong>题目</strong> 有n个人围成一圈，顺序排号。从第一个人开始报数（从1到3报数），凡报到3的人退出圈子，问最后留下的是原来第几号的那位。</p>
<p><strong>程序分析</strong> 无。</p>
<pre><code class="prism language-python"><span class="token keyword">if</span> __name__ <span class="token operator">==</span> <span class="token string">'__main__'</span><span class="token punctuation">:</span>
    nmax <span class="token operator">=</span> <span class="token number">50</span>
    n <span class="token operator">=</span> <span class="token builtin">int</span><span class="token punctuation">(</span><span class="token builtin">input</span><span class="token punctuation">(</span><span class="token string">'请输入总人数:'</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
    num <span class="token operator">=</span> <span class="token punctuation">[</span><span class="token punctuation">]</span>
    <span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span>n<span class="token punctuation">)</span><span class="token punctuation">:</span>
        num<span class="token punctuation">.</span>append<span class="token punctuation">(</span>i <span class="token operator">+</span> <span class="token number">1</span><span class="token punctuation">)</span>
 
    i <span class="token operator">=</span> <span class="token number">0</span>
    k <span class="token operator">=</span> <span class="token number">0</span>
    m <span class="token operator">=</span> <span class="token number">0</span>
 
    <span class="token keyword">while</span> m <span class="token operator">&lt;</span> n <span class="token operator">-</span> <span class="token number">1</span><span class="token punctuation">:</span>
        <span class="token keyword">if</span> num<span class="token punctuation">[</span>i<span class="token punctuation">]</span> <span class="token operator">!=</span> <span class="token number">0</span> <span class="token punctuation">:</span> k <span class="token operator">+=</span> <span class="token number">1</span>
        <span class="token keyword">if</span> k <span class="token operator">==</span> <span class="token number">3</span><span class="token punctuation">:</span>
            num<span class="token punctuation">[</span>i<span class="token punctuation">]</span> <span class="token operator">=</span> <span class="token number">0</span>
            k <span class="token operator">=</span> <span class="token number">0</span>
            m <span class="token operator">+=</span> <span class="token number">1</span>
        i <span class="token operator">+=</span> <span class="token number">1</span>
        <span class="token keyword">if</span> i <span class="token operator">==</span> n <span class="token punctuation">:</span> i <span class="token operator">=</span> <span class="token number">0</span>
 
    i <span class="token operator">=</span> <span class="token number">0</span>
    <span class="token keyword">while</span> num<span class="token punctuation">[</span>i<span class="token punctuation">]</span> <span class="token operator">==</span> <span class="token number">0</span><span class="token punctuation">:</span> i <span class="token operator">+=</span> <span class="token number">1</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span>num<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">)</span>
</code></pre>
<h4><a id="070II_1414"></a>实例070：字符串长度II</h4>
<p><strong>题目</strong> 写一个函数，求一个字符串的长度，在main函数中输入字符串，并输出其长度。</p>
<p><strong>程序分析</strong> 无。</p>
<pre><code class="prism language-python"><span class="token keyword">def</span> <span class="token function">lenofstr</span><span class="token punctuation">(</span>s<span class="token punctuation">)</span><span class="token punctuation">:</span>
    <span class="token keyword">return</span> <span class="token builtin">len</span><span class="token punctuation">(</span>s<span class="token punctuation">)</span>

<span class="token keyword">print</span><span class="token punctuation">(</span>lenofstr<span class="token punctuation">(</span><span class="token string">'tanxiaofengsheng'</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
</code></pre>
<h4><a id="071_1427"></a>实例071：输入和输出</h4>
<p><strong>题目</strong> 编写input()和output()函数输入，输出5个学生的数据记录。</p>
<p><strong>程序分析</strong> 无。</p>
<pre><code class="prism language-python">N <span class="token operator">=</span> <span class="token number">3</span>
<span class="token comment">#stu</span>
<span class="token comment"># num : string</span>
<span class="token comment"># name : string</span>
<span class="token comment"># score[4]: list</span>
student <span class="token operator">=</span> <span class="token punctuation">[</span><span class="token punctuation">]</span>
<span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token number">5</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
    student<span class="token punctuation">.</span>append<span class="token punctuation">(</span><span class="token punctuation">[</span><span class="token string">''</span><span class="token punctuation">,</span><span class="token string">''</span><span class="token punctuation">,</span><span class="token punctuation">[</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">)</span>
 
<span class="token keyword">def</span> <span class="token function">input_stu</span><span class="token punctuation">(</span>stu<span class="token punctuation">)</span><span class="token punctuation">:</span>
    <span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span>N<span class="token punctuation">)</span><span class="token punctuation">:</span>
        stu<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span> <span class="token operator">=</span> <span class="token builtin">input</span><span class="token punctuation">(</span><span class="token string">'input student num:\n'</span><span class="token punctuation">)</span>
        stu<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span> <span class="token operator">=</span> <span class="token builtin">input</span><span class="token punctuation">(</span><span class="token string">'input student name:\n'</span><span class="token punctuation">)</span>
        <span class="token keyword">for</span> j <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token number">3</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
            stu<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">[</span><span class="token number">2</span><span class="token punctuation">]</span><span class="token punctuation">.</span>append<span class="token punctuation">(</span><span class="token builtin">int</span><span class="token punctuation">(</span><span class="token builtin">input</span><span class="token punctuation">(</span><span class="token string">'score:\n'</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
 
<span class="token keyword">def</span> <span class="token function">output_stu</span><span class="token punctuation">(</span>stu<span class="token punctuation">)</span><span class="token punctuation">:</span>
    <span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span>N<span class="token punctuation">)</span><span class="token punctuation">:</span>
        <span class="token keyword">print</span> <span class="token punctuation">(</span><span class="token string">'%-6s%-10s'</span> <span class="token operator">%</span> <span class="token punctuation">(</span> stu<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">,</span>stu<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span> <span class="token punctuation">)</span><span class="token punctuation">)</span>
        <span class="token keyword">for</span> j <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token number">3</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
            <span class="token keyword">print</span> <span class="token punctuation">(</span><span class="token string">'%-8d'</span> <span class="token operator">%</span> stu<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">[</span><span class="token number">2</span><span class="token punctuation">]</span><span class="token punctuation">[</span>j<span class="token punctuation">]</span><span class="token punctuation">)</span>
 
<span class="token keyword">if</span> __name__ <span class="token operator">==</span> <span class="token string">'__main__'</span><span class="token punctuation">:</span>
    input_stu<span class="token punctuation">(</span>student<span class="token punctuation">)</span>
    <span class="token keyword">print</span> <span class="token punctuation">(</span>student<span class="token punctuation">)</span>
    output_stu<span class="token punctuation">(</span>student<span class="token punctuation">)</span>
</code></pre>
<h4><a id="072_1462"></a>实例072：创建链表</h4>
<p><strong>题目</strong> 创建一个链表。</p>
<p><strong>程序分析</strong> 原文不太靠谱。</p>
<pre><code class="prism language-python"><span class="token keyword">class</span> <span class="token class-name">Node</span><span class="token punctuation">:</span>

    <span class="token keyword">def</span> <span class="token function">__init__</span><span class="token punctuation">(</span>self<span class="token punctuation">,</span> data<span class="token punctuation">)</span><span class="token punctuation">:</span>
        self<span class="token punctuation">.</span>data <span class="token operator">=</span> data
        self<span class="token punctuation">.</span><span class="token builtin">next</span> <span class="token operator">=</span> <span class="token boolean">None</span>

    <span class="token keyword">def</span> <span class="token function">get_data</span><span class="token punctuation">(</span>self<span class="token punctuation">)</span><span class="token punctuation">:</span>
        <span class="token keyword">return</span> self<span class="token punctuation">.</span>data

<span class="token keyword">class</span> <span class="token class-name">List</span><span class="token punctuation">:</span>

    <span class="token keyword">def</span> <span class="token function">__init__</span><span class="token punctuation">(</span>self<span class="token punctuation">,</span> head<span class="token punctuation">)</span><span class="token punctuation">:</span>
        self<span class="token punctuation">.</span>head <span class="token operator">=</span> head

    <span class="token keyword">def</span> <span class="token function">is_empty</span><span class="token punctuation">(</span>self<span class="token punctuation">)</span><span class="token punctuation">:</span> 
        <span class="token keyword">return</span> self<span class="token punctuation">.</span>get_len<span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token operator">==</span> <span class="token number">0</span>

    <span class="token keyword">def</span> <span class="token function">get_len</span><span class="token punctuation">(</span>self<span class="token punctuation">)</span><span class="token punctuation">:</span>  
        length <span class="token operator">=</span> <span class="token number">0</span>
        temp <span class="token operator">=</span> self<span class="token punctuation">.</span>head
        <span class="token keyword">while</span> temp <span class="token keyword">is</span> <span class="token operator">not</span> <span class="token boolean">None</span><span class="token punctuation">:</span>
            length <span class="token operator">+=</span> <span class="token number">1</span>
            temp <span class="token operator">=</span> temp<span class="token punctuation">.</span><span class="token builtin">next</span>
        <span class="token keyword">return</span> length

    <span class="token keyword">def</span> <span class="token function">append</span><span class="token punctuation">(</span>self<span class="token punctuation">,</span> node<span class="token punctuation">)</span><span class="token punctuation">:</span>
        temp <span class="token operator">=</span> self<span class="token punctuation">.</span>head
        <span class="token keyword">while</span> temp<span class="token punctuation">.</span><span class="token builtin">next</span> <span class="token keyword">is</span> <span class="token operator">not</span> <span class="token boolean">None</span><span class="token punctuation">:</span>
            temp <span class="token operator">=</span> temp<span class="token punctuation">.</span><span class="token builtin">next</span>
        temp<span class="token punctuation">.</span><span class="token builtin">next</span> <span class="token operator">=</span> node

    <span class="token keyword">def</span> <span class="token function">delete</span><span class="token punctuation">(</span>self<span class="token punctuation">,</span> index<span class="token punctuation">)</span><span class="token punctuation">:</span> 
        <span class="token keyword">if</span> index <span class="token operator">&lt;</span> <span class="token number">1</span> <span class="token operator">or</span> index <span class="token operator">&gt;</span> self<span class="token punctuation">.</span>get_len<span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
            <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">"给定位置不合理"</span><span class="token punctuation">)</span>
            <span class="token keyword">return</span>
        <span class="token keyword">if</span> index <span class="token operator">==</span> <span class="token number">1</span><span class="token punctuation">:</span>
            self<span class="token punctuation">.</span>head <span class="token operator">=</span> self<span class="token punctuation">.</span>head<span class="token punctuation">.</span><span class="token builtin">next</span>
            <span class="token keyword">return</span>
        temp <span class="token operator">=</span> self<span class="token punctuation">.</span>head
        cur_pos <span class="token operator">=</span> <span class="token number">0</span>
        <span class="token keyword">while</span> temp <span class="token keyword">is</span> <span class="token operator">not</span> <span class="token boolean">None</span><span class="token punctuation">:</span>
            cur_pos <span class="token operator">+=</span> <span class="token number">1</span>
            <span class="token keyword">if</span> cur_pos <span class="token operator">==</span> index<span class="token operator">-</span><span class="token number">1</span><span class="token punctuation">:</span>
                temp<span class="token punctuation">.</span><span class="token builtin">next</span> <span class="token operator">=</span> temp<span class="token punctuation">.</span><span class="token builtin">next</span><span class="token punctuation">.</span><span class="token builtin">next</span>
            temp <span class="token operator">=</span> temp<span class="token punctuation">.</span><span class="token builtin">next</span>

    <span class="token keyword">def</span> <span class="token function">insert</span><span class="token punctuation">(</span>self<span class="token punctuation">,</span> pos<span class="token punctuation">,</span> node<span class="token punctuation">)</span><span class="token punctuation">:</span>
        <span class="token keyword">if</span> pos <span class="token operator">&lt;</span> <span class="token number">1</span> <span class="token operator">or</span> pos <span class="token operator">&gt;</span> self<span class="token punctuation">.</span>get_len<span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
            <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">"插入结点位置不合理"</span><span class="token punctuation">)</span>
            <span class="token keyword">return</span>
        temp <span class="token operator">=</span> self<span class="token punctuation">.</span>head
        cur_pos <span class="token operator">=</span> <span class="token number">0</span>
        <span class="token keyword">while</span> temp <span class="token keyword">is</span> <span class="token operator">not</span> Node<span class="token punctuation">:</span>
            cur_pos <span class="token operator">+=</span> <span class="token number">1</span>
            <span class="token keyword">if</span> cur_pos <span class="token operator">==</span> pos<span class="token operator">-</span><span class="token number">1</span><span class="token punctuation">:</span>
                node<span class="token punctuation">.</span><span class="token builtin">next</span> <span class="token operator">=</span> temp<span class="token punctuation">.</span><span class="token builtin">next</span>
                temp<span class="token punctuation">.</span><span class="token builtin">next</span> <span class="token operator">=</span>node
                <span class="token keyword">break</span>
            temp <span class="token operator">=</span> temp<span class="token punctuation">.</span><span class="token builtin">next</span>

    <span class="token keyword">def</span> <span class="token function">reverse</span><span class="token punctuation">(</span>self<span class="token punctuation">,</span> head<span class="token punctuation">)</span><span class="token punctuation">:</span>
        <span class="token keyword">if</span> head <span class="token keyword">is</span> <span class="token boolean">None</span> <span class="token operator">and</span> head<span class="token punctuation">.</span><span class="token builtin">next</span> <span class="token keyword">is</span> <span class="token boolean">None</span><span class="token punctuation">:</span>
            <span class="token keyword">return</span> head
        pre <span class="token operator">=</span> head
        cur <span class="token operator">=</span> head<span class="token punctuation">.</span><span class="token builtin">next</span>
        <span class="token keyword">while</span> cur <span class="token keyword">is</span> <span class="token operator">not</span> <span class="token boolean">None</span><span class="token punctuation">:</span>
            temp <span class="token operator">=</span> cur<span class="token punctuation">.</span><span class="token builtin">next</span>
            cur<span class="token punctuation">.</span><span class="token builtin">next</span> <span class="token operator">=</span> pre
            pre <span class="token operator">=</span> cur
            cur <span class="token operator">=</span> temp
        head<span class="token punctuation">.</span><span class="token builtin">next</span> <span class="token operator">=</span> <span class="token boolean">None</span>
        <span class="token keyword">return</span> pre

    <span class="token keyword">def</span> <span class="token function">print_list</span><span class="token punctuation">(</span>self<span class="token punctuation">,</span> head<span class="token punctuation">)</span><span class="token punctuation">:</span>
        init_data <span class="token operator">=</span> <span class="token punctuation">[</span><span class="token punctuation">]</span>
        <span class="token keyword">while</span> head <span class="token keyword">is</span> <span class="token operator">not</span> <span class="token boolean">None</span><span class="token punctuation">:</span>
            init_data<span class="token punctuation">.</span>append<span class="token punctuation">(</span>head<span class="token punctuation">.</span>get_data<span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
            head <span class="token operator">=</span> head<span class="token punctuation">.</span><span class="token builtin">next</span>
        <span class="token keyword">return</span> init_data

<span class="token keyword">if</span> __name__<span class="token operator">==</span><span class="token string">'__main__'</span><span class="token punctuation">:</span>
    head<span class="token operator">=</span>Node<span class="token punctuation">(</span><span class="token string">'head'</span><span class="token punctuation">)</span>
    link<span class="token operator">=</span>List<span class="token punctuation">(</span>head<span class="token punctuation">)</span>
    <span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token number">10</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
        node<span class="token operator">=</span>Node<span class="token punctuation">(</span>i<span class="token punctuation">)</span>
        link<span class="token punctuation">.</span>append<span class="token punctuation">(</span>node<span class="token punctuation">)</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span>link<span class="token punctuation">.</span>print_list<span class="token punctuation">(</span>head<span class="token punctuation">)</span><span class="token punctuation">)</span>
</code></pre>
<h4><a id="073_1558"></a>实例073：反向输出链表</h4>
<p><strong>题目</strong> 反向输出一个链表。</p>
<p><strong>程序分析</strong> 无。</p>
<pre><code class="prism language-python"><span class="token keyword">class</span> <span class="token class-name">Node</span><span class="token punctuation">:</span>

    <span class="token keyword">def</span> <span class="token function">__init__</span><span class="token punctuation">(</span>self<span class="token punctuation">,</span> data<span class="token punctuation">)</span><span class="token punctuation">:</span>
        self<span class="token punctuation">.</span>data <span class="token operator">=</span> data
        self<span class="token punctuation">.</span><span class="token builtin">next</span> <span class="token operator">=</span> <span class="token boolean">None</span>

    <span class="token keyword">def</span> <span class="token function">get_data</span><span class="token punctuation">(</span>self<span class="token punctuation">)</span><span class="token punctuation">:</span>
        <span class="token keyword">return</span> self<span class="token punctuation">.</span>data

<span class="token keyword">class</span> <span class="token class-name">List</span><span class="token punctuation">:</span>

    <span class="token keyword">def</span> <span class="token function">__init__</span><span class="token punctuation">(</span>self<span class="token punctuation">,</span> head<span class="token punctuation">)</span><span class="token punctuation">:</span>
        self<span class="token punctuation">.</span>head <span class="token operator">=</span> head

    <span class="token keyword">def</span> <span class="token function">is_empty</span><span class="token punctuation">(</span>self<span class="token punctuation">)</span><span class="token punctuation">:</span> 
        <span class="token keyword">return</span> self<span class="token punctuation">.</span>get_len<span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token operator">==</span> <span class="token number">0</span>

    <span class="token keyword">def</span> <span class="token function">get_len</span><span class="token punctuation">(</span>self<span class="token punctuation">)</span><span class="token punctuation">:</span>  
        length <span class="token operator">=</span> <span class="token number">0</span>
        temp <span class="token operator">=</span> self<span class="token punctuation">.</span>head
        <span class="token keyword">while</span> temp <span class="token keyword">is</span> <span class="token operator">not</span> <span class="token boolean">None</span><span class="token punctuation">:</span>
            length <span class="token operator">+=</span> <span class="token number">1</span>
            temp <span class="token operator">=</span> temp<span class="token punctuation">.</span><span class="token builtin">next</span>
        <span class="token keyword">return</span> length

    <span class="token keyword">def</span> <span class="token function">append</span><span class="token punctuation">(</span>self<span class="token punctuation">,</span> node<span class="token punctuation">)</span><span class="token punctuation">:</span>
        temp <span class="token operator">=</span> self<span class="token punctuation">.</span>head
        <span class="token keyword">while</span> temp<span class="token punctuation">.</span><span class="token builtin">next</span> <span class="token keyword">is</span> <span class="token operator">not</span> <span class="token boolean">None</span><span class="token punctuation">:</span>
            temp <span class="token operator">=</span> temp<span class="token punctuation">.</span><span class="token builtin">next</span>
        temp<span class="token punctuation">.</span><span class="token builtin">next</span> <span class="token operator">=</span> node

    <span class="token keyword">def</span> <span class="token function">delete</span><span class="token punctuation">(</span>self<span class="token punctuation">,</span> index<span class="token punctuation">)</span><span class="token punctuation">:</span> 
        <span class="token keyword">if</span> index <span class="token operator">&lt;</span> <span class="token number">1</span> <span class="token operator">or</span> index <span class="token operator">&gt;</span> self<span class="token punctuation">.</span>get_len<span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
            <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">"给定位置不合理"</span><span class="token punctuation">)</span>
            <span class="token keyword">return</span>
        <span class="token keyword">if</span> index <span class="token operator">==</span> <span class="token number">1</span><span class="token punctuation">:</span>
            self<span class="token punctuation">.</span>head <span class="token operator">=</span> self<span class="token punctuation">.</span>head<span class="token punctuation">.</span><span class="token builtin">next</span>
            <span class="token keyword">return</span>
        temp <span class="token operator">=</span> self<span class="token punctuation">.</span>head
        cur_pos <span class="token operator">=</span> <span class="token number">0</span>
        <span class="token keyword">while</span> temp <span class="token keyword">is</span> <span class="token operator">not</span> <span class="token boolean">None</span><span class="token punctuation">:</span>
            cur_pos <span class="token operator">+=</span> <span class="token number">1</span>
            <span class="token keyword">if</span> cur_pos <span class="token operator">==</span> index<span class="token operator">-</span><span class="token number">1</span><span class="token punctuation">:</span>
                temp<span class="token punctuation">.</span><span class="token builtin">next</span> <span class="token operator">=</span> temp<span class="token punctuation">.</span><span class="token builtin">next</span><span class="token punctuation">.</span><span class="token builtin">next</span>
            temp <span class="token operator">=</span> temp<span class="token punctuation">.</span><span class="token builtin">next</span>

    <span class="token keyword">def</span> <span class="token function">insert</span><span class="token punctuation">(</span>self<span class="token punctuation">,</span> pos<span class="token punctuation">,</span> node<span class="token punctuation">)</span><span class="token punctuation">:</span>
        <span class="token keyword">if</span> pos <span class="token operator">&lt;</span> <span class="token number">1</span> <span class="token operator">or</span> pos <span class="token operator">&gt;</span> self<span class="token punctuation">.</span>get_len<span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
            <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">"插入结点位置不合理"</span><span class="token punctuation">)</span>
            <span class="token keyword">return</span>
        temp <span class="token operator">=</span> self<span class="token punctuation">.</span>head
        cur_pos <span class="token operator">=</span> <span class="token number">0</span>
        <span class="token keyword">while</span> temp <span class="token keyword">is</span> <span class="token operator">not</span> Node<span class="token punctuation">:</span>
            cur_pos <span class="token operator">+=</span> <span class="token number">1</span>
            <span class="token keyword">if</span> cur_pos <span class="token operator">==</span> pos<span class="token operator">-</span><span class="token number">1</span><span class="token punctuation">:</span>
                node<span class="token punctuation">.</span><span class="token builtin">next</span> <span class="token operator">=</span> temp<span class="token punctuation">.</span><span class="token builtin">next</span>
                temp<span class="token punctuation">.</span><span class="token builtin">next</span> <span class="token operator">=</span>node
                <span class="token keyword">break</span>
            temp <span class="token operator">=</span> temp<span class="token punctuation">.</span><span class="token builtin">next</span>

    <span class="token keyword">def</span> <span class="token function">reverse</span><span class="token punctuation">(</span>self<span class="token punctuation">,</span> head<span class="token punctuation">)</span><span class="token punctuation">:</span>
        <span class="token keyword">if</span> head <span class="token keyword">is</span> <span class="token boolean">None</span> <span class="token operator">and</span> head<span class="token punctuation">.</span><span class="token builtin">next</span> <span class="token keyword">is</span> <span class="token boolean">None</span><span class="token punctuation">:</span>
            <span class="token keyword">return</span> head
        pre <span class="token operator">=</span> head
        cur <span class="token operator">=</span> head<span class="token punctuation">.</span><span class="token builtin">next</span>
        <span class="token keyword">while</span> cur <span class="token keyword">is</span> <span class="token operator">not</span> <span class="token boolean">None</span><span class="token punctuation">:</span>
            temp <span class="token operator">=</span> cur<span class="token punctuation">.</span><span class="token builtin">next</span>
            cur<span class="token punctuation">.</span><span class="token builtin">next</span> <span class="token operator">=</span> pre
            pre <span class="token operator">=</span> cur
            cur <span class="token operator">=</span> temp
        head<span class="token punctuation">.</span><span class="token builtin">next</span> <span class="token operator">=</span> <span class="token boolean">None</span>
        <span class="token keyword">return</span> pre

    <span class="token keyword">def</span> <span class="token function">print_list</span><span class="token punctuation">(</span>self<span class="token punctuation">,</span> head<span class="token punctuation">)</span><span class="token punctuation">:</span>
        init_data <span class="token operator">=</span> <span class="token punctuation">[</span><span class="token punctuation">]</span>
        <span class="token keyword">while</span> head <span class="token keyword">is</span> <span class="token operator">not</span> <span class="token boolean">None</span><span class="token punctuation">:</span>
            init_data<span class="token punctuation">.</span>append<span class="token punctuation">(</span>head<span class="token punctuation">.</span>get_data<span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
            head <span class="token operator">=</span> head<span class="token punctuation">.</span><span class="token builtin">next</span>
        <span class="token keyword">return</span> init_data

<span class="token keyword">if</span> __name__<span class="token operator">==</span><span class="token string">'__main__'</span><span class="token punctuation">:</span>
    head<span class="token operator">=</span>Node<span class="token punctuation">(</span><span class="token string">'head'</span><span class="token punctuation">)</span>
    link<span class="token operator">=</span>List<span class="token punctuation">(</span>head<span class="token punctuation">)</span>
    <span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token number">10</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
        node<span class="token operator">=</span>Node<span class="token punctuation">(</span>i<span class="token punctuation">)</span>
        link<span class="token punctuation">.</span>append<span class="token punctuation">(</span>node<span class="token punctuation">)</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span>link<span class="token punctuation">.</span>print_list<span class="token punctuation">(</span>head<span class="token punctuation">)</span><span class="token punctuation">)</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span>link<span class="token punctuation">.</span>print_list<span class="token punctuation">(</span>link<span class="token punctuation">.</span>reverse<span class="token punctuation">(</span>head<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
</code></pre>
<h4><a id="074_1655"></a>实例074：列表排序、连接</h4>
<p><strong>题目</strong> 列表排序及连接。</p>
<p><strong>程序分析</strong> 排序可使用 sort() 方法，连接可以使用 + 号或 extend() 方法。</p>
<pre><code class="prism language-python">a<span class="token operator">=</span><span class="token punctuation">[</span><span class="token number">2</span><span class="token punctuation">,</span><span class="token number">6</span><span class="token punctuation">,</span><span class="token number">8</span><span class="token punctuation">]</span>
b<span class="token operator">=</span><span class="token punctuation">[</span><span class="token number">7</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">4</span><span class="token punctuation">]</span>
a<span class="token punctuation">.</span>extend<span class="token punctuation">(</span>b<span class="token punctuation">)</span>
a<span class="token punctuation">.</span>sort<span class="token punctuation">(</span><span class="token punctuation">)</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>a<span class="token punctuation">)</span>
</code></pre>
<h4><a id="075_1669"></a>实例075：不知所云</h4>
<p><strong>题目</strong> 放松一下，算一道简单的题目。</p>
<p><strong>程序分析</strong> 鬼知道是什么。</p>
<pre><code class="prism language-python"><span class="token keyword">if</span> __name__ <span class="token operator">==</span> <span class="token string">'__main__'</span><span class="token punctuation">:</span>
    <span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token number">5</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
        n <span class="token operator">=</span> <span class="token number">0</span>
        <span class="token keyword">if</span> i <span class="token operator">!=</span> <span class="token number">1</span><span class="token punctuation">:</span> n <span class="token operator">+=</span> <span class="token number">1</span>
        <span class="token keyword">if</span> i <span class="token operator">==</span> <span class="token number">3</span><span class="token punctuation">:</span> n <span class="token operator">+=</span> <span class="token number">1</span>
        <span class="token keyword">if</span> i <span class="token operator">==</span> <span class="token number">4</span><span class="token punctuation">:</span> n <span class="token operator">+=</span> <span class="token number">1</span>
        <span class="token keyword">if</span> i <span class="token operator">!=</span> <span class="token number">4</span><span class="token punctuation">:</span> n <span class="token operator">+=</span> <span class="token number">1</span>
        <span class="token keyword">if</span> n <span class="token operator">==</span> <span class="token number">3</span><span class="token punctuation">:</span> <span class="token keyword">print</span> <span class="token punctuation">(</span><span class="token number">64</span> <span class="token operator">+</span> i<span class="token punctuation">)</span>
</code></pre>
<h4><a id="076_1686"></a>实例076：做函数</h4>
<p><strong>题目</strong> 编写一个函数，输入n为偶数时，调用函数求1/2+1/4+…+1/n,当输入n为奇数时，调用函数1/1+1/3+…+1/n</p>
<p><strong>程序分析</strong> 无。</p>
<pre><code class="prism language-python"><span class="token keyword">def</span> <span class="token function">peven</span><span class="token punctuation">(</span>n<span class="token punctuation">)</span><span class="token punctuation">:</span>
    i <span class="token operator">=</span> <span class="token number">0</span>
    s <span class="token operator">=</span> <span class="token number">0.0</span>
    <span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token number">2</span><span class="token punctuation">,</span>n <span class="token operator">+</span> <span class="token number">1</span><span class="token punctuation">,</span><span class="token number">2</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
        s <span class="token operator">+=</span> <span class="token number">1.0</span> <span class="token operator">/</span> i
    <span class="token keyword">return</span> s
 
<span class="token keyword">def</span> <span class="token function">podd</span><span class="token punctuation">(</span>n<span class="token punctuation">)</span><span class="token punctuation">:</span>
    s <span class="token operator">=</span> <span class="token number">0.0</span>
    <span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token number">1</span><span class="token punctuation">,</span> n <span class="token operator">+</span> <span class="token number">1</span><span class="token punctuation">,</span><span class="token number">2</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
        s <span class="token operator">+=</span> <span class="token number">1.0</span> <span class="token operator">/</span> i
    <span class="token keyword">return</span> s
 
<span class="token keyword">def</span> <span class="token function">dcall</span><span class="token punctuation">(</span>fp<span class="token punctuation">,</span>n<span class="token punctuation">)</span><span class="token punctuation">:</span>
    s <span class="token operator">=</span> fp<span class="token punctuation">(</span>n<span class="token punctuation">)</span>
    <span class="token keyword">return</span> s
 
<span class="token keyword">if</span> __name__ <span class="token operator">==</span> <span class="token string">'__main__'</span><span class="token punctuation">:</span>
    n <span class="token operator">=</span> <span class="token builtin">int</span><span class="token punctuation">(</span><span class="token builtin">input</span><span class="token punctuation">(</span><span class="token string">'input a number: '</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
    <span class="token keyword">if</span> n <span class="token operator">%</span> <span class="token number">2</span> <span class="token operator">==</span> <span class="token number">0</span><span class="token punctuation">:</span>
        <span class="token builtin">sum</span> <span class="token operator">=</span> dcall<span class="token punctuation">(</span>peven<span class="token punctuation">,</span>n<span class="token punctuation">)</span>
    <span class="token keyword">else</span><span class="token punctuation">:</span>
        <span class="token builtin">sum</span> <span class="token operator">=</span> dcall<span class="token punctuation">(</span>podd<span class="token punctuation">,</span>n<span class="token punctuation">)</span>
    <span class="token keyword">print</span> <span class="token punctuation">(</span><span class="token builtin">sum</span><span class="token punctuation">)</span>
</code></pre>
<h4><a id="077_1719"></a>实例077：遍历列表</h4>
<p><strong>题目</strong> 循环输出列表</p>
<p><strong>程序分析</strong> 无。</p>
<pre><code class="prism language-python">l<span class="token operator">=</span><span class="token punctuation">[</span><span class="token string">'moyu'</span><span class="token punctuation">,</span><span class="token string">'niupi'</span><span class="token punctuation">,</span><span class="token string">'xuecaibichi'</span><span class="token punctuation">,</span><span class="token string">'shengfaji'</span><span class="token punctuation">,</span><span class="token string">'42'</span><span class="token punctuation">]</span>
<span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token builtin">len</span><span class="token punctuation">(</span>l<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span>l<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">)</span>
</code></pre>
<h4><a id="078_1731"></a>实例078：字典</h4>
<p><strong>题目</strong> 找到年龄最大的人，并输出。请找出程序中有什么问题。</p>
<p><strong>程序分析</strong> 无。</p>
<pre><code class="prism language-python"><span class="token keyword">if</span> __name__ <span class="token operator">==</span> <span class="token string">'__main__'</span><span class="token punctuation">:</span>
    person <span class="token operator">=</span> <span class="token punctuation">{</span><span class="token string">"li"</span><span class="token punctuation">:</span><span class="token number">18</span><span class="token punctuation">,</span><span class="token string">"wang"</span><span class="token punctuation">:</span><span class="token number">50</span><span class="token punctuation">,</span><span class="token string">"zhang"</span><span class="token punctuation">:</span><span class="token number">20</span><span class="token punctuation">,</span><span class="token string">"sun"</span><span class="token punctuation">:</span><span class="token number">22</span><span class="token punctuation">}</span>
    m <span class="token operator">=</span> <span class="token string">'li'</span>
    <span class="token keyword">for</span> key <span class="token keyword">in</span> person<span class="token punctuation">.</span>keys<span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
        <span class="token keyword">if</span> person<span class="token punctuation">[</span>m<span class="token punctuation">]</span> <span class="token operator">&lt;</span> person<span class="token punctuation">[</span>key<span class="token punctuation">]</span><span class="token punctuation">:</span>
            m <span class="token operator">=</span> key
 
    <span class="token keyword">print</span> <span class="token punctuation">(</span><span class="token string">'%s,%d'</span> <span class="token operator">%</span> <span class="token punctuation">(</span>m<span class="token punctuation">,</span>person<span class="token punctuation">[</span>m<span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
</code></pre>
<h4><a id="079_1748"></a>实例079：字符串排序</h4>
<p><strong>题目</strong> 字符串排序。</p>
<p><strong>程序分析</strong> 无。</p>
<pre><code class="prism language-python">l<span class="token operator">=</span><span class="token punctuation">[</span><span class="token string">'baaa'</span><span class="token punctuation">,</span><span class="token string">'aaab'</span><span class="token punctuation">,</span><span class="token string">'aaba'</span><span class="token punctuation">,</span><span class="token string">'aaaa'</span><span class="token punctuation">,</span><span class="token string">'abaa'</span><span class="token punctuation">]</span>
l<span class="token punctuation">.</span>sort<span class="token punctuation">(</span><span class="token punctuation">)</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>l<span class="token punctuation">)</span>
</code></pre>
<h4><a id="080_1760"></a>实例080：猴子分桃</h4>
<p><strong>题目</strong> 海滩上有一堆桃子，五只猴子来分。第一只猴子把这堆桃子平均分为五份，多了一个，这只猴子把多的一个扔入海中，拿走了一份。第二只猴子把剩下的桃子又平均分成五份，又多了一个，它同样把多的一个扔入海中，拿走了一份，第三、第四、第五只猴子都是这样做的，问海滩上原来最少有多少个桃子？</p>
<p><strong>程序分析</strong> 无。</p>
<pre><code class="prism language-python"><span class="token keyword">if</span> __name__ <span class="token operator">==</span> <span class="token string">'__main__'</span><span class="token punctuation">:</span>
    i <span class="token operator">=</span> <span class="token number">0</span>
    j <span class="token operator">=</span> <span class="token number">1</span>
    x <span class="token operator">=</span> <span class="token number">0</span>
    <span class="token keyword">while</span> <span class="token punctuation">(</span>i <span class="token operator">&lt;</span> <span class="token number">5</span><span class="token punctuation">)</span> <span class="token punctuation">:</span>
        x <span class="token operator">=</span> <span class="token number">4</span> <span class="token operator">*</span> j
        <span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">5</span><span class="token punctuation">)</span> <span class="token punctuation">:</span>
            <span class="token keyword">if</span><span class="token punctuation">(</span>x<span class="token operator">%</span><span class="token number">4</span> <span class="token operator">!=</span> <span class="token number">0</span><span class="token punctuation">)</span> <span class="token punctuation">:</span>
                <span class="token keyword">break</span>
            <span class="token keyword">else</span> <span class="token punctuation">:</span>
                i <span class="token operator">+=</span> <span class="token number">1</span>
            x <span class="token operator">=</span> <span class="token punctuation">(</span>x<span class="token operator">/</span><span class="token number">4</span><span class="token punctuation">)</span> <span class="token operator">*</span> <span class="token number">5</span> <span class="token operator">+</span><span class="token number">1</span>
        j <span class="token operator">+=</span> <span class="token number">1</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span>x<span class="token punctuation">)</span>

    <span class="token keyword">for</span> p <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token number">5</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
        x<span class="token operator">=</span><span class="token punctuation">(</span>x<span class="token operator">-</span><span class="token number">1</span><span class="token punctuation">)</span><span class="token operator">/</span><span class="token number">5</span><span class="token operator">*</span><span class="token number">4</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span>x<span class="token punctuation">)</span>
</code></pre>
<h4><a id="081_1787"></a>实例081：求未知数</h4>
<p><strong>题目</strong> 809*??=800*??+9*?? 其中??代表的两位数, 809*??为四位数，8*??的结果为两位数，9*??的结果为3位数。求??代表的两位数，及809*??后的结果。</p>
<p><strong>程序分析</strong> 无。</p>
<pre><code class="prism language-python">a <span class="token operator">=</span> <span class="token number">809</span>
<span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token number">10</span><span class="token punctuation">,</span><span class="token number">100</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
    b <span class="token operator">=</span> i <span class="token operator">*</span> a
    <span class="token keyword">if</span> b <span class="token operator">&gt;=</span> <span class="token number">1000</span> <span class="token operator">and</span> b <span class="token operator">&lt;=</span> <span class="token number">10000</span> <span class="token operator">and</span> <span class="token number">8</span> <span class="token operator">*</span> i <span class="token operator">&lt;</span> <span class="token number">100</span> <span class="token operator">and</span> <span class="token number">9</span> <span class="token operator">*</span> i <span class="token operator">&gt;=</span> <span class="token number">100</span><span class="token punctuation">:</span>
        <span class="token keyword">print</span><span class="token punctuation">(</span>b<span class="token punctuation">,</span><span class="token string">' = 800 * '</span><span class="token punctuation">,</span> i<span class="token punctuation">,</span> <span class="token string">' + 9 * '</span><span class="token punctuation">,</span> i<span class="token punctuation">)</span>


<span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token number">10</span><span class="token punctuation">,</span><span class="token number">100</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
    <span class="token keyword">if</span> <span class="token number">8</span><span class="token operator">*</span>i<span class="token operator">&gt;</span><span class="token number">99</span> <span class="token operator">or</span> <span class="token number">9</span><span class="token operator">*</span>i<span class="token operator">&lt;</span><span class="token number">100</span><span class="token punctuation">:</span>
        <span class="token keyword">continue</span>
    <span class="token keyword">if</span> <span class="token number">809</span><span class="token operator">*</span>i<span class="token operator">==</span><span class="token number">800</span><span class="token operator">*</span>i<span class="token operator">+</span><span class="token number">9</span><span class="token operator">*</span>i<span class="token punctuation">:</span>
        <span class="token keyword">print</span><span class="token punctuation">(</span>i<span class="token punctuation">)</span>
        <span class="token keyword">break</span>
</code></pre>
<h4><a id="082_1810"></a>实例082：八进制转十进制</h4>
<p><strong>题目</strong> 八进制转换为十进制</p>
<p><strong>程序分析</strong> 无。</p>
<pre><code class="prism language-python">n<span class="token operator">=</span><span class="token builtin">eval</span><span class="token punctuation">(</span><span class="token string">'0o'</span><span class="token operator">+</span><span class="token builtin">str</span><span class="token punctuation">(</span><span class="token builtin">int</span><span class="token punctuation">(</span><span class="token builtin">input</span><span class="token punctuation">(</span><span class="token string">'八进制输入：'</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>n<span class="token punctuation">)</span>
</code></pre>
<h4><a id="083_1821"></a>实例083：制作奇数</h4>
<p><strong>题目</strong> 求0—7所能组成的奇数个数。</p>
<p><strong>程序分析</strong></p>
<p>组成1位数是4个。1,3,5,7结尾</p>
<p>组成2位数是7*4个。第一位不能为0</p>
<p>组成3位数是7*8*4个。中间随意</p>
<p>组成4位数是7*8*8*4个。</p>
<pre><code class="prism language-python"><span class="token keyword">if</span> __name__ <span class="token operator">==</span> <span class="token string">'__main__'</span><span class="token punctuation">:</span>
    <span class="token builtin">sum</span> <span class="token operator">=</span> <span class="token number">4</span>
    s <span class="token operator">=</span> <span class="token number">4</span>
    <span class="token keyword">for</span> j <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token number">2</span><span class="token punctuation">,</span><span class="token number">9</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
        <span class="token keyword">print</span> <span class="token punctuation">(</span><span class="token builtin">sum</span><span class="token punctuation">)</span>
        <span class="token keyword">if</span> j <span class="token operator">&lt;=</span> <span class="token number">2</span><span class="token punctuation">:</span>
            s <span class="token operator">*=</span> <span class="token number">7</span>
        <span class="token keyword">else</span><span class="token punctuation">:</span>
            s <span class="token operator">*=</span> <span class="token number">8</span>
        <span class="token builtin">sum</span> <span class="token operator">+=</span> s
    <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">'sum = %d'</span> <span class="token operator">%</span> <span class="token builtin">sum</span><span class="token punctuation">)</span>
</code></pre>
<h4><a id="084_1849"></a>实例084：连接字符串</h4>
<p><strong>题目</strong> 连接字符串。</p>
<p><strong>程序分析</strong> 无。</p>
<pre><code class="prism language-python">delimiter <span class="token operator">=</span> <span class="token string">','</span>
mylist <span class="token operator">=</span> <span class="token punctuation">[</span><span class="token string">'Brazil'</span><span class="token punctuation">,</span> <span class="token string">'Russia'</span><span class="token punctuation">,</span> <span class="token string">'India'</span><span class="token punctuation">,</span> <span class="token string">'China'</span><span class="token punctuation">]</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>delimiter<span class="token punctuation">.</span>join<span class="token punctuation">(</span>mylist<span class="token punctuation">)</span><span class="token punctuation">)</span>
</code></pre>
<h4><a id="085_1861"></a>实例085：整除</h4>
<p><strong>题目</strong> 输入一个奇数，然后判断最少几个 9 除于该数的结果为整数。</p>
<p><strong>程序分析</strong> 999999 / 13 = 76923。</p>
<pre><code class="prism language-python"><span class="token keyword">if</span> __name__ <span class="token operator">==</span> <span class="token string">'__main__'</span><span class="token punctuation">:</span>
    zi <span class="token operator">=</span> <span class="token builtin">int</span><span class="token punctuation">(</span><span class="token builtin">input</span><span class="token punctuation">(</span><span class="token string">'输入一个数字:'</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
    n1 <span class="token operator">=</span> <span class="token number">1</span>
    c9 <span class="token operator">=</span> <span class="token number">1</span>
    m9 <span class="token operator">=</span> <span class="token number">9</span>
    <span class="token builtin">sum</span> <span class="token operator">=</span> <span class="token number">9</span>
    <span class="token keyword">while</span> n1 <span class="token operator">!=</span> <span class="token number">0</span><span class="token punctuation">:</span>
        <span class="token keyword">if</span> <span class="token builtin">sum</span> <span class="token operator">%</span> zi <span class="token operator">==</span> <span class="token number">0</span><span class="token punctuation">:</span>
            n1 <span class="token operator">=</span> <span class="token number">0</span>
        <span class="token keyword">else</span><span class="token punctuation">:</span>
            m9 <span class="token operator">*=</span> <span class="token number">10</span>
            <span class="token builtin">sum</span> <span class="token operator">+=</span> m9
            c9 <span class="token operator">+=</span> <span class="token number">1</span>
    <span class="token keyword">print</span> <span class="token punctuation">(</span><span class="token string">'%d 个 9 可以被 %d 整除 : %d'</span> <span class="token operator">%</span> <span class="token punctuation">(</span>c9<span class="token punctuation">,</span>zi<span class="token punctuation">,</span><span class="token builtin">sum</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
    r <span class="token operator">=</span> <span class="token builtin">sum</span> <span class="token operator">/</span> zi
    <span class="token keyword">print</span> <span class="token punctuation">(</span><span class="token string">'%d / %d = %d'</span> <span class="token operator">%</span> <span class="token punctuation">(</span><span class="token builtin">sum</span><span class="token punctuation">,</span>zi<span class="token punctuation">,</span>r<span class="token punctuation">)</span><span class="token punctuation">)</span>
</code></pre>
<h4><a id="086II_1886"></a>实例086：连接字符串II</h4>
<p><strong>题目</strong> 两个字符串连接程序。</p>
<p><strong>程序分析</strong> 无。</p>
<pre><code class="prism language-python">a<span class="token operator">=</span><span class="token string">'guangtou'</span>
b<span class="token operator">=</span><span class="token string">'feipang'</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>b<span class="token operator">+</span>a<span class="token punctuation">)</span>
</code></pre>
<h4><a id="087_1898"></a>实例087：访问类成员</h4>
<p><strong>题目</strong> 回答结果（结构体变量传递）。</p>
<p><strong>程序分析</strong> 无。</p>
<pre><code class="prism language-python"><span class="token keyword">if</span> __name__ <span class="token operator">==</span> <span class="token string">'__main__'</span><span class="token punctuation">:</span>
    <span class="token keyword">class</span> <span class="token class-name">student</span><span class="token punctuation">:</span>
        x <span class="token operator">=</span> <span class="token number">0</span>
        c <span class="token operator">=</span> <span class="token number">0</span>
    <span class="token keyword">def</span> <span class="token function">f</span><span class="token punctuation">(</span>stu<span class="token punctuation">)</span><span class="token punctuation">:</span>
        stu<span class="token punctuation">.</span>x <span class="token operator">=</span> <span class="token number">20</span>
        stu<span class="token punctuation">.</span>c <span class="token operator">=</span> <span class="token string">'c'</span>
    a<span class="token operator">=</span> student<span class="token punctuation">(</span><span class="token punctuation">)</span>
    a<span class="token punctuation">.</span>x <span class="token operator">=</span> <span class="token number">3</span>
    a<span class="token punctuation">.</span>c <span class="token operator">=</span> <span class="token string">'a'</span>
    f<span class="token punctuation">(</span>a<span class="token punctuation">)</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span>a<span class="token punctuation">.</span>x<span class="token punctuation">,</span>a<span class="token punctuation">.</span>c<span class="token punctuation">)</span>
</code></pre>
<h4><a id="088_1919"></a>实例088：打印星号</h4>
<p><strong>题目</strong> 读取7个数（1—50）的整数值，每读取一个值，程序打印出该值个数的＊。</p>
<p><strong>程序分析</strong> 无。</p>
<pre><code class="prism language-python"><span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token number">3</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">'*'</span><span class="token operator">*</span><span class="token builtin">int</span><span class="token punctuation">(</span><span class="token builtin">input</span><span class="token punctuation">(</span><span class="token string">'input a number: '</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
</code></pre>
<h4><a id="089_1930"></a>实例089：解码</h4>
<p><strong>题目</strong> 某个公司采用公用电话传递数据，数据是四位的整数，在传递过程中是加密的，加密规则如下：每位数字都加上5,然后用和除以10的余数代替该数字，再将第一位和第四位交换，第二位和第三位交换。</p>
<p><strong>程序分析</strong> 无。</p>
<pre><code class="prism language-python">n<span class="token operator">=</span><span class="token builtin">input</span><span class="token punctuation">(</span><span class="token punctuation">)</span>
n <span class="token operator">=</span> <span class="token builtin">str</span><span class="token punctuation">(</span>n<span class="token punctuation">)</span>
a<span class="token operator">=</span><span class="token punctuation">[</span><span class="token punctuation">]</span>
<span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token number">4</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
    a<span class="token punctuation">.</span>append<span class="token punctuation">(</span><span class="token punctuation">(</span><span class="token builtin">int</span><span class="token punctuation">(</span>n<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token operator">+</span><span class="token number">5</span><span class="token punctuation">)</span><span class="token operator">%</span><span class="token number">10</span><span class="token punctuation">)</span>
a<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">,</span>a<span class="token punctuation">[</span><span class="token number">3</span><span class="token punctuation">]</span><span class="token operator">=</span>a<span class="token punctuation">[</span><span class="token number">3</span><span class="token punctuation">]</span><span class="token punctuation">,</span>a<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span>
a<span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">,</span>a<span class="token punctuation">[</span><span class="token number">2</span><span class="token punctuation">]</span><span class="token operator">=</span>a<span class="token punctuation">[</span><span class="token number">2</span><span class="token punctuation">]</span><span class="token punctuation">,</span>a<span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span>
<span class="token keyword">print</span> <span class="token punctuation">(</span><span class="token string">""</span><span class="token punctuation">.</span>join<span class="token punctuation">(</span><span class="token string">'%s'</span> <span class="token operator">%</span>s <span class="token keyword">for</span> s <span class="token keyword">in</span> a<span class="token punctuation">)</span><span class="token punctuation">)</span>

</code></pre>
<h4><a id="090_1948"></a>实例090：列表详解</h4>
<p><strong>题目</strong> 列表使用实例。</p>
<p><strong>程序分析</strong> 无。</p>
<pre><code class="prism language-python"><span class="token comment">#list  </span>
<span class="token comment">#新建列表  </span>
testList<span class="token operator">=</span><span class="token punctuation">[</span><span class="token number">10086</span><span class="token punctuation">,</span><span class="token string">'中国移动'</span><span class="token punctuation">,</span><span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">,</span><span class="token number">2</span><span class="token punctuation">,</span><span class="token number">4</span><span class="token punctuation">,</span><span class="token number">5</span><span class="token punctuation">]</span><span class="token punctuation">]</span>  
  
<span class="token comment">#访问列表长度  </span>
<span class="token keyword">print</span> <span class="token punctuation">(</span><span class="token builtin">len</span><span class="token punctuation">(</span>testList<span class="token punctuation">)</span>  <span class="token punctuation">)</span>
<span class="token comment">#到列表结尾  </span>
<span class="token keyword">print</span> <span class="token punctuation">(</span>testList<span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">:</span><span class="token punctuation">]</span><span class="token punctuation">)</span>
<span class="token comment">#向列表添加元素  </span>
testList<span class="token punctuation">.</span>append<span class="token punctuation">(</span><span class="token string">'i\'m new here!'</span><span class="token punctuation">)</span>  
  
<span class="token keyword">print</span> <span class="token punctuation">(</span><span class="token builtin">len</span><span class="token punctuation">(</span>testList<span class="token punctuation">)</span>  <span class="token punctuation">)</span>
<span class="token keyword">print</span> <span class="token punctuation">(</span>testList<span class="token punctuation">[</span><span class="token operator">-</span><span class="token number">1</span><span class="token punctuation">]</span>  <span class="token punctuation">)</span>
<span class="token comment">#弹出列表的最后一个元素  </span>
<span class="token keyword">print</span> <span class="token punctuation">(</span>testList<span class="token punctuation">.</span>pop<span class="token punctuation">(</span><span class="token number">1</span><span class="token punctuation">)</span>  <span class="token punctuation">)</span>
<span class="token keyword">print</span> <span class="token punctuation">(</span><span class="token builtin">len</span><span class="token punctuation">(</span>testList<span class="token punctuation">)</span>  <span class="token punctuation">)</span>
<span class="token keyword">print</span> <span class="token punctuation">(</span>testList  <span class="token punctuation">)</span>
<span class="token comment">#list comprehension  </span>
<span class="token comment">#后面有介绍，暂时掠过  </span>
matrix <span class="token operator">=</span> <span class="token punctuation">[</span><span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">,</span> <span class="token number">2</span><span class="token punctuation">,</span> <span class="token number">3</span><span class="token punctuation">]</span><span class="token punctuation">,</span>  
<span class="token punctuation">[</span><span class="token number">4</span><span class="token punctuation">,</span> <span class="token number">5</span><span class="token punctuation">,</span> <span class="token number">6</span><span class="token punctuation">]</span><span class="token punctuation">,</span>  
<span class="token punctuation">[</span><span class="token number">7</span><span class="token punctuation">,</span> <span class="token number">8</span><span class="token punctuation">,</span> <span class="token number">9</span><span class="token punctuation">]</span><span class="token punctuation">]</span>  
<span class="token keyword">print</span> <span class="token punctuation">(</span>matrix  <span class="token punctuation">)</span>
<span class="token keyword">print</span> <span class="token punctuation">(</span>matrix<span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span>  <span class="token punctuation">)</span>
col2 <span class="token operator">=</span> <span class="token punctuation">[</span>row<span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span> <span class="token keyword">for</span> row <span class="token keyword">in</span> matrix<span class="token punctuation">]</span><span class="token comment">#get a  column from a matrix  </span>
<span class="token keyword">print</span> <span class="token punctuation">(</span>col2  <span class="token punctuation">)</span>
col2even <span class="token operator">=</span> <span class="token punctuation">[</span>row<span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span> <span class="token keyword">for</span> row <span class="token keyword">in</span> matrix <span class="token keyword">if</span>  row<span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span> <span class="token operator">%</span> <span class="token number">2</span> <span class="token operator">==</span> <span class="token number">0</span><span class="token punctuation">]</span><span class="token comment">#filter odd item  </span>
<span class="token keyword">print</span> <span class="token punctuation">(</span>col2even<span class="token punctuation">)</span>
</code></pre>
<h4><a id="091time_1985"></a>实例091：time模块</h4>
<p><strong>题目</strong> 时间函数举例1。</p>
<p><strong>程序分析</strong> 无。</p>
<pre><code class="prism language-python"><span class="token keyword">if</span> __name__ <span class="token operator">==</span> <span class="token string">'__main__'</span><span class="token punctuation">:</span>
    <span class="token keyword">import</span> time
    <span class="token keyword">print</span> <span class="token punctuation">(</span>time<span class="token punctuation">.</span>ctime<span class="token punctuation">(</span>time<span class="token punctuation">.</span>time<span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
    <span class="token keyword">print</span> <span class="token punctuation">(</span>time<span class="token punctuation">.</span>asctime<span class="token punctuation">(</span>time<span class="token punctuation">.</span>localtime<span class="token punctuation">(</span>time<span class="token punctuation">.</span>time<span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
    <span class="token keyword">print</span> <span class="token punctuation">(</span>time<span class="token punctuation">.</span>asctime<span class="token punctuation">(</span>time<span class="token punctuation">.</span>gmtime<span class="token punctuation">(</span>time<span class="token punctuation">.</span>time<span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
</code></pre>
<h4><a id="092timeII_1999"></a>实例092：time模块II</h4>
<p><strong>题目</strong> 时间函数举例2。</p>
<p><strong>程序分析</strong> 如何浪费时间。</p>
<pre><code class="prism language-python"><span class="token keyword">if</span> __name__ <span class="token operator">==</span> <span class="token string">'__main__'</span><span class="token punctuation">:</span>
    <span class="token keyword">import</span> time
    start <span class="token operator">=</span> time<span class="token punctuation">.</span>time<span class="token punctuation">(</span><span class="token punctuation">)</span>
    <span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token number">3000</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
        <span class="token keyword">print</span><span class="token punctuation">(</span>i<span class="token punctuation">)</span>
    end <span class="token operator">=</span> time<span class="token punctuation">.</span>time<span class="token punctuation">(</span><span class="token punctuation">)</span>
 
    <span class="token keyword">print</span> <span class="token punctuation">(</span>end <span class="token operator">-</span> start<span class="token punctuation">)</span>
</code></pre>
<h4><a id="093timeIII_2016"></a>实例093：time模块III</h4>
<p><strong>题目</strong> 时间函数举例3。</p>
<p><strong>程序分析</strong> 如何浪费时间。</p>
<pre><code class="prism language-python"><span class="token keyword">if</span> __name__ <span class="token operator">==</span> <span class="token string">'__main__'</span><span class="token punctuation">:</span>
    <span class="token keyword">import</span> time
    start <span class="token operator">=</span> time<span class="token punctuation">.</span>clock<span class="token punctuation">(</span><span class="token punctuation">)</span>
    <span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token number">100</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
        <span class="token keyword">print</span><span class="token punctuation">(</span>i<span class="token punctuation">)</span>
    end <span class="token operator">=</span> time<span class="token punctuation">.</span>clock<span class="token punctuation">(</span><span class="token punctuation">)</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">'different is %6.3f'</span> <span class="token operator">%</span> <span class="token punctuation">(</span>end <span class="token operator">-</span> start<span class="token punctuation">)</span><span class="token punctuation">)</span>
</code></pre>
<h4><a id="094timeIV_2032"></a>实例094：time模块IV</h4>
<p><strong>题目</strong> 时间函数举例4。</p>
<p><strong>程序分析</strong> 如何浪费时间。</p>
<pre><code class="prism language-python"><span class="token keyword">if</span> __name__ <span class="token operator">==</span> <span class="token string">'__main__'</span><span class="token punctuation">:</span>
    <span class="token keyword">import</span> time
    <span class="token keyword">import</span> random
    
    play_it <span class="token operator">=</span> <span class="token builtin">input</span><span class="token punctuation">(</span><span class="token string">'do you want to play it.(\'y\' or \'n\')'</span><span class="token punctuation">)</span>
    <span class="token keyword">while</span> play_it <span class="token operator">==</span> <span class="token string">'y'</span><span class="token punctuation">:</span>
        c <span class="token operator">=</span> <span class="token builtin">input</span><span class="token punctuation">(</span><span class="token string">'input a character:\n'</span><span class="token punctuation">)</span>
        i <span class="token operator">=</span> random<span class="token punctuation">.</span>randint<span class="token punctuation">(</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">2</span><span class="token operator">**</span><span class="token number">32</span><span class="token punctuation">)</span> <span class="token operator">%</span> <span class="token number">100</span>
        <span class="token keyword">print</span> <span class="token punctuation">(</span><span class="token string">'please input number you guess:\n'</span><span class="token punctuation">)</span>
        start <span class="token operator">=</span> time<span class="token punctuation">.</span>clock<span class="token punctuation">(</span><span class="token punctuation">)</span>
        a <span class="token operator">=</span> time<span class="token punctuation">.</span>time<span class="token punctuation">(</span><span class="token punctuation">)</span>
        guess <span class="token operator">=</span> <span class="token builtin">int</span><span class="token punctuation">(</span><span class="token builtin">input</span><span class="token punctuation">(</span><span class="token string">'input your guess:\n'</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
        <span class="token keyword">while</span> guess <span class="token operator">!=</span> i<span class="token punctuation">:</span>
            <span class="token keyword">if</span> guess <span class="token operator">&gt;</span> i<span class="token punctuation">:</span>
                <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">'please input a little smaller'</span><span class="token punctuation">)</span>
                guess <span class="token operator">=</span> <span class="token builtin">int</span><span class="token punctuation">(</span><span class="token builtin">input</span><span class="token punctuation">(</span><span class="token string">'input your guess:\n'</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
            <span class="token keyword">else</span><span class="token punctuation">:</span>
                <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">'please input a little bigger'</span><span class="token punctuation">)</span>
                guess <span class="token operator">=</span> <span class="token builtin">int</span><span class="token punctuation">(</span><span class="token builtin">input</span><span class="token punctuation">(</span><span class="token string">'input your guess:\n'</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
        end <span class="token operator">=</span> time<span class="token punctuation">.</span>clock<span class="token punctuation">(</span><span class="token punctuation">)</span>
        b <span class="token operator">=</span> time<span class="token punctuation">.</span>time<span class="token punctuation">(</span><span class="token punctuation">)</span>
        var <span class="token operator">=</span> <span class="token punctuation">(</span>end <span class="token operator">-</span> start<span class="token punctuation">)</span> <span class="token operator">/</span> <span class="token number">18.2</span>
        <span class="token keyword">print</span> <span class="token punctuation">(</span>var<span class="token punctuation">)</span>
        <span class="token comment"># print 'It took you %6.3 seconds' % time.difftime(b,a))</span>
        <span class="token keyword">if</span> var <span class="token operator">&lt;</span> <span class="token number">15</span><span class="token punctuation">:</span>
            <span class="token keyword">print</span> <span class="token punctuation">(</span><span class="token string">'you are very clever!'</span><span class="token punctuation">)</span>
        <span class="token keyword">elif</span> var <span class="token operator">&lt;</span> <span class="token number">25</span><span class="token punctuation">:</span>
            <span class="token keyword">print</span> <span class="token punctuation">(</span><span class="token string">'you are normal!'</span><span class="token punctuation">)</span>
        <span class="token keyword">else</span><span class="token punctuation">:</span>
            <span class="token keyword">print</span> <span class="token punctuation">(</span><span class="token string">'you are stupid!'</span><span class="token punctuation">)</span>
        <span class="token keyword">print</span> <span class="token punctuation">(</span><span class="token string">'Congradulations'</span><span class="token punctuation">)</span>
        <span class="token keyword">print</span> <span class="token punctuation">(</span><span class="token string">'The number you guess is %d'</span> <span class="token operator">%</span> i<span class="token punctuation">)</span>
        play_it <span class="token operator">=</span> <span class="token builtin">input</span><span class="token punctuation">(</span><span class="token string">'do you want to play it.'</span><span class="token punctuation">)</span>
</code></pre>
<h4><a id="095_2074"></a>实例095：转换时间格式</h4>
<p><strong>题目</strong> 字符串日期转换为易读的日期格式。</p>
<p><strong>程序分析</strong> 看看就得了，dateutil是个第三方库。</p>
<pre><code class="prism language-python"><span class="token keyword">from</span> dateutil <span class="token keyword">import</span> parser
dt <span class="token operator">=</span> parser<span class="token punctuation">.</span>parse<span class="token punctuation">(</span><span class="token string">"Aug 28 2015 12:00AM"</span><span class="token punctuation">)</span>
<span class="token keyword">print</span> <span class="token punctuation">(</span>dt<span class="token punctuation">)</span>
</code></pre>
<h4><a id="096_2086"></a>实例096：计算复读次数</h4>
<p><strong>题目</strong> 计算字符串中子串出现的次数。</p>
<p><strong>程序分析</strong> 无。</p>
<pre><code class="prism language-python">s1<span class="token operator">=</span><span class="token string">'xuebixuebixuebixuebixuebixuebixuebixue'</span>
s2<span class="token operator">=</span><span class="token string">'xuebi'</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>s1<span class="token punctuation">.</span>count<span class="token punctuation">(</span>s2<span class="token punctuation">)</span><span class="token punctuation">)</span>
</code></pre>
<h4><a id="097_2098"></a>实例097：磁盘写入</h4>
<p><strong>题目</strong> 从键盘输入一些字符，逐个把它们写到磁盘文件上，直到输入一个 # 为止。</p>
<p><strong>程序分析</strong> 无。</p>
<pre><code class="prism language-python"><span class="token keyword">if</span> __name__ <span class="token operator">==</span> <span class="token string">'__main__'</span><span class="token punctuation">:</span>
    <span class="token keyword">from</span> sys <span class="token keyword">import</span> stdout
    filename <span class="token operator">=</span> <span class="token builtin">input</span><span class="token punctuation">(</span><span class="token string">'输入文件名:\n'</span><span class="token punctuation">)</span>
    fp <span class="token operator">=</span> <span class="token builtin">open</span><span class="token punctuation">(</span>filename<span class="token punctuation">,</span><span class="token string">"w"</span><span class="token punctuation">)</span>
    ch <span class="token operator">=</span> <span class="token builtin">input</span><span class="token punctuation">(</span><span class="token string">'输入字符串:\n'</span><span class="token punctuation">)</span>
    <span class="token keyword">while</span> ch <span class="token operator">!=</span> <span class="token string">'#'</span><span class="token punctuation">:</span>
        fp<span class="token punctuation">.</span>write<span class="token punctuation">(</span>ch<span class="token punctuation">)</span>
        stdout<span class="token punctuation">.</span>write<span class="token punctuation">(</span>ch<span class="token punctuation">)</span>
        ch <span class="token operator">=</span> <span class="token builtin">input</span><span class="token punctuation">(</span><span class="token string">''</span><span class="token punctuation">)</span>
    fp<span class="token punctuation">.</span>close<span class="token punctuation">(</span><span class="token punctuation">)</span>
</code></pre>
<h4><a id="098II_2117"></a>实例098：磁盘写入II</h4>
<p><strong>题目</strong> 从键盘输入一个字符串，将小写字母全部转换成大写字母，然后输出到一个磁盘文件"test"中保存。</p>
<p><strong>程序分析</strong> 无。</p>
<pre><code class="prism language-python"><span class="token keyword">if</span> __name__ <span class="token operator">==</span> <span class="token string">'__main__'</span><span class="token punctuation">:</span>
    fp <span class="token operator">=</span> <span class="token builtin">open</span><span class="token punctuation">(</span><span class="token string">'test.txt'</span><span class="token punctuation">,</span><span class="token string">'w'</span><span class="token punctuation">)</span>
    string <span class="token operator">=</span> <span class="token builtin">input</span><span class="token punctuation">(</span><span class="token string">'please input a string:\n'</span><span class="token punctuation">)</span>
    string <span class="token operator">=</span> string<span class="token punctuation">.</span>upper<span class="token punctuation">(</span><span class="token punctuation">)</span>
    fp<span class="token punctuation">.</span>write<span class="token punctuation">(</span>string<span class="token punctuation">)</span>
    fp <span class="token operator">=</span> <span class="token builtin">open</span><span class="token punctuation">(</span><span class="token string">'test.txt'</span><span class="token punctuation">,</span><span class="token string">'r'</span><span class="token punctuation">)</span>
    <span class="token keyword">print</span> <span class="token punctuation">(</span>fp<span class="token punctuation">.</span>read<span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
    fp<span class="token punctuation">.</span>close<span class="token punctuation">(</span><span class="token punctuation">)</span>
</code></pre>
<h4><a id="099_2134"></a>实例099：磁盘读写</h4>
<p><strong>题目</strong> 有两个磁盘文件A和B,各存放一行字母,要求把这两个文件中的信息合并(按字母顺序排列), 输出到一个新文件C中。</p>
<p><strong>程序分析</strong> 无。</p>
<pre><code class="prism language-python"><span class="token keyword">if</span> __name__ <span class="token operator">==</span> <span class="token string">'__main__'</span><span class="token punctuation">:</span>
    <span class="token keyword">import</span> string
    fp <span class="token operator">=</span> <span class="token builtin">open</span><span class="token punctuation">(</span><span class="token string">'test1.txt'</span><span class="token punctuation">)</span>
    a <span class="token operator">=</span> fp<span class="token punctuation">.</span>read<span class="token punctuation">(</span><span class="token punctuation">)</span>
    fp<span class="token punctuation">.</span>close<span class="token punctuation">(</span><span class="token punctuation">)</span>
 
    fp <span class="token operator">=</span> <span class="token builtin">open</span><span class="token punctuation">(</span><span class="token string">'test2.txt'</span><span class="token punctuation">)</span>
    b <span class="token operator">=</span> fp<span class="token punctuation">.</span>read<span class="token punctuation">(</span><span class="token punctuation">)</span>
    fp<span class="token punctuation">.</span>close<span class="token punctuation">(</span><span class="token punctuation">)</span>
 
    fp <span class="token operator">=</span> <span class="token builtin">open</span><span class="token punctuation">(</span><span class="token string">'test3.txt'</span><span class="token punctuation">,</span><span class="token string">'w'</span><span class="token punctuation">)</span>
    l <span class="token operator">=</span> <span class="token builtin">list</span><span class="token punctuation">(</span>a <span class="token operator">+</span> b<span class="token punctuation">)</span>
    l<span class="token punctuation">.</span>sort<span class="token punctuation">(</span><span class="token punctuation">)</span>
    s <span class="token operator">=</span> <span class="token string">''</span>
    s <span class="token operator">=</span> s<span class="token punctuation">.</span>join<span class="token punctuation">(</span>l<span class="token punctuation">)</span>
    fp<span class="token punctuation">.</span>write<span class="token punctuation">(</span>s<span class="token punctuation">)</span>
    fp<span class="token punctuation">.</span>close<span class="token punctuation">(</span><span class="token punctuation">)</span>
</code></pre>
<h4><a id="100_2160"></a>实例100：列表转字典</h4>
<p><strong>题目</strong> 列表转换为字典。</p>
<p><strong>程序分析</strong> 无。</p>
<pre><code class="prism language-python">i <span class="token operator">=</span> <span class="token punctuation">[</span><span class="token string">'a'</span><span class="token punctuation">,</span> <span class="token string">'b'</span><span class="token punctuation">]</span>
l <span class="token operator">=</span> <span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">,</span> <span class="token number">2</span><span class="token punctuation">]</span>
<span class="token keyword">print</span> <span class="token punctuation">(</span><span class="token builtin">dict</span><span class="token punctuation">(</span><span class="token builtin">zip</span><span class="token punctuation">(</span>i<span class="token punctuation">,</span>l<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
</code></pre>

                                    </div>
                <link href="https://csdnimg.cn/release/phoenix/mdeditor/markdown_views-b6c3c6d139.css" rel="stylesheet">
                    </div>
    </article>
    <div class="postTime"> 
        <div class="article-bar-bottom">
            <span class="time">
                文章最后发布于: 2018-08-10 16:01:27            </span>
        </div>
    </div>
</div>

            <div class="hide-article-box hide-article-pos text-center">
            <a class="btn-readmore" data-report-view='{"mod":"popu_376","dest":"https://blog.csdn.net/weixin_41084236/article/details/81564963","strategy":"readmore"}' data-report-click='{"mod":"popu_376","dest":"https://blog.csdn.net/weixin_41084236/article/details/81564963","strategy":"readmore"}'>
                展开阅读全文
                <svg class="icon chevrondown" aria-hidden="true">
                    <use xlink:href="#csdnc-chevrondown"></use>
                </svg>
            </a>
        </div>
                <!--打赏开始-->
                            <div class="reward-user-box">
                    <span class="reward-word" style="color:#B4B4B4 !important">有 <span class="num">0</span> 个人打赏</span>
                                        <a target="_blank" href="https://im.csdn.net/im/main.html?userName=weixin_41084236" data-report-click='{"mod":"popu_810","dest":"私信"}'  data-report-view='{"mod":"popu_810","dest":"私信"}' id="profile-content-alink" >
                         <div class="reward-fexd" id="">
                    <!-- iconcsdnc-bookmark -->
                    <svg class="reward-icon" aria-hidden="true">
					<use xlink:href="#csdnc-envelope"></use>
				    </svg>
                    <div>私信求帮助</div>
                    </div>
                    </a>
                   
                </div>
                        <!--打赏结束-->
            <div id="dmp_ad_58"><div id="kp_box_58" data-pid="58"><div style="width:100%;background:#fff;">
<script type="text/javascript" src="//rabc1.iteye.com/production/resource/web/6xwm4l.js?lg=ydmpioh"></script>
</div><img class="pre-img-lasy" data-src="https://kunyu.csdn.net/1.png?p=58&a=386&c=0&k=&d=1&t=3&u=d657a139e00b4c168ec9026b6f65aac5"></div></div>            
            <a id="commentBox"></a>
<div class="comment-box">
	<div class="comment-edit-box d-flex">
		<a id="commentsedit"></a>
		<div class="user-img">
			<a href="javascript:void(0);" target="_blank" rel="noopener">
				<img class="show_loginbox" src="//g.csdnimg.cn/static/user-img/anonymous-User-img.png">
			</a>
		</div>
		<form id="commentform">
			<input type="hidden" id="comment_replyId">
			<textarea class="comment-content" name="comment_content" id="comment_content" placeholder="想对作者说点什么"></textarea>
			<div class="opt-box"> <!-- d-flex -->
				<div id="ubbtools" class="add_code">
					<a href="#insertcode" code="code" target="_self"><i class="icon iconfont icon-daima"></i></a>
				</div>
				<input type="hidden" id="comment_replyId" name="comment_replyId">
				<input type="hidden" id="article_id" name="article_id" value="81564963">
				<input type="hidden" id="comment_userId" name="comment_userId" value="">
				<input type="hidden" id="commentId" name="commentId" value="">
				<div style="display: none;" class="csdn-tracking-statistics tracking-click" data-report-click='{"mod":"popu_384","dest":""}'><a href="#" target="_blank" class="comment_area_btn" rel="noopener">发表评论</a></div>
				<div class="dropdown" id="myDrap">
					<a class="dropdown-face d-flex align-items-center" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
					<div class="txt-selected text-truncate">添加代码片</div>
					<svg class="icon d-block" aria-hidden="true">
						<use xlink:href="#csdnc-triangledown"></use>
					</svg>
					</a>
					<ul class="dropdown-menu" id="commentCode" aria-labelledby="drop4">
						<li><a data-code="html">HTML/XML</a></li>
						<li><a data-code="objc">objective-c</a></li>
						<li><a data-code="ruby">Ruby</a></li>
						<li><a data-code="php">PHP</a></li>
						<li><a data-code="csharp">C</a></li>
						<li><a data-code="cpp">C++</a></li>
						<li><a data-code="javascript">JavaScript</a></li>
						<li><a data-code="python">Python</a></li>
						<li><a data-code="java">Java</a></li>
						<li><a data-code="css">CSS</a></li>
						<li><a data-code="sql">SQL</a></li>
						<li><a data-code="plain">其它</a></li>
					</ul>
				</div>  
				<div class="right-box">
                                        <span id="tip_comment" class="tip">还能输入<em>1000</em>个字符</span>
					<input type="button" class="btn btn-sm btn-cancel d-none" value="取消回复">
					<input type="submit" class="btn btn-sm btn-red btn-comment" value="发表评论">
				</div>
			</div>
		</form>
	</div>

	<div class="comment-list-container">
		<a id="comments"></a>
		<div class="comment-list-box">
		</div>
		<div id="commentPage" class="pagination-box d-none"></div>
		<div class="opt-box text-center">
			<div class="btn btn-sm btn-link-blue" id="btnMoreComment"></div>
		</div>
	</div>
</div>
            <!--付费专栏入口开始-->
                            <div class="blog-column-pay">
                    <div class="column-pay-left">
                        <a href="https://blog.csdn.net/xufive/article/category/9506563?utm_source=payColumnDetails" target="_blank">
                        <img src="https://img-blog.csdnimg.cn/20191114120359988.png" alt="">
                        </a>
                    </div>
                    <div class="column-pay-right">
                        <div class="title">
                            <a href="https://blog.csdn.net/xufive/article/category/9506563?utm_source=payColumnDetails" target="_blank" class="topic">跟“风云卫星”数据工程师学Python</a>
                            <a href="https://blog.csdn.net/xufive/article/category/9506563?utm_source=payColumnDetails" target="_blank" class="column-pay-subscription">立即订阅</a>
                        </div>
                        <div class="introduce">曾参与过风云系列卫星、碳卫星、子午工程、嫦娥等项目的数据处理工作；有超10年大型项目的开发经验。
专栏收入了作者为Python爱好者精心打造的多篇文章，从小白入门学习的基础语法、基础模块精讲等内容外，还提出了“Python语感训练”的概念和方法，不仅为初学者提供了进阶之路，有一定基础的程序员亦可从中受益。后续，本专栏还将加入2D/3D应用开发、数据处理、实战项目等精品内容，敬请期待。</div>
                        <div class="information">
                            <a href="https://blog.csdn.net/xufive/article/category/9506563?utm_source=payColumnDetails" target="_blank">
                            <img src="https://profile.csdnimg.cn/1/3/9/3_xufive" alt="" username="xufive"><span class="name">xufive</span></a>
                            <span class="column-money"><span class="money">¥3.80 </span><span>1441人订阅</span></span>
                        </div>
                    </div>
                </div>
                        <!--付费专栏入口结束-->
            <div class="recommend-box">
                                    <div class="recommend-item-box type_blog clearfix"  data-report-click='{"mod":"popu_387","dest":"https://blog.csdn.net/Ch97CKd/article/details/80823328","strategy":"BlogCommendFromMachineLearnPai2","index":"0"}'>
	<div class="content">
		<a href="https://blog.csdn.net/Ch97CKd/article/details/80823328" target="_blank"  rel="noopener" title="18个Python爬虫实战案例（已开源）">
		<h4 class="text-truncate oneline">
				18个<em>Python</em>爬虫实战案例（已开源）		</h4>
		<div class="info-box d-flex align-content-center">
			<p class="date-and-readNum oneline">
				<span class="date hover-show">06-26</span>
				<span class="read-num hover-hide">
					阅读数 
					2万+</span>
				</p>
			</div>
		</a>
		<p class="content">
			<a href="https://blog.csdn.net/Ch97CKd/article/details/80823328" target="_blank" rel="noopener" title="18个Python爬虫实战案例（已开源）">
				<span class="desc oneline">目录爬虫小工具文件下载小助手爬虫实战笔趣看小说下载VIP视频下载百度文库文章下载_rev1百度文库文章下载_rev2《帅啊》网帅哥图片下载构建代理IP池《火影忍者》漫画下......</span>
			</a>
			<span class="blog_title_box oneline ">
									<span class="type-show type-show-blog type-show-after">博文</span>
											<a target="_blank" rel="noopener" href="https://blog.csdn.net/Ch97CKd">来自：	<span class="blog_title"> 突围的鱼</span></a>
												</span>
		</p>
	</div>
	</div>

	
	
<div class="recommend-item-box type_blog clearfix"  data-report-click='{"mod":"popu_387","dest":"https://blog.csdn.net/qq_41597912/article/details/79710972","strategy":"BlogCommendFromMachineLearnPai2","index":"1"}'>
	<div class="content">
		<a href="https://blog.csdn.net/qq_41597912/article/details/79710972" target="_blank"  rel="noopener" title="十个Python练手的实战项目，学会这些Python就基本没问题了">
		<h4 class="text-truncate oneline">
				十个<em>Python</em>练手的实战项目，学会这些<em>Python</em>就基本没问题了		</h4>
		<div class="info-box d-flex align-content-center">
			<p class="date-and-readNum oneline">
				<span class="date hover-show">03-27</span>
				<span class="read-num hover-hide">
					阅读数 
					8万+</span>
				</p>
			</div>
		</a>
		<p class="content">
			<a href="https://blog.csdn.net/qq_41597912/article/details/79710972" target="_blank" rel="noopener" title="十个Python练手的实战项目，学会这些Python就基本没问题了">
				<span class="desc oneline">话不多说，直接开搞！练习项目一：即时标记这里还是要推荐下小编的Python学习群:483546416，不管你是小白还是大牛，小编我都欢迎，不定期分享干货，包括小编自己整理的一份2017最新的Pytho...</span>
			</a>
			<span class="blog_title_box oneline ">
									<span class="type-show type-show-blog type-show-after">博文</span>
											<a target="_blank" rel="noopener" href="https://blog.csdn.net/qq_41597912">来自：	<span class="blog_title"> Python达人</span></a>
												</span>
		</p>
	</div>
	</div>

	
	
<div class="recommend-item-box type_blog clearfix"  data-report-click='{"mod":"popu_387","dest":"https://blog.csdn.net/weixin_37998647/article/details/79047113","strategy":"BlogCommendFromMachineLearnPai2","index":"2"}'>
	<div class="content">
		<a href="https://blog.csdn.net/weixin_37998647/article/details/79047113" target="_blank"  rel="noopener" title="Python练手经典100例">
		<h4 class="text-truncate oneline">
				<em>Python</em>练手经典100例		</h4>
		<div class="info-box d-flex align-content-center">
			<p class="date-and-readNum oneline">
				<span class="date hover-show">01-12</span>
				<span class="read-num hover-hide">
					阅读数 
					5万+</span>
				</p>
			</div>
		</a>
		<p class="content">
			<a href="https://blog.csdn.net/weixin_37998647/article/details/79047113" target="_blank" rel="noopener" title="Python练手经典100例">
				<span class="desc oneline">本博文转载自：http://blog.csdn.net/dajiangtai007/article/details/65632987100个Python练手小程序，学习python的很好的资料，覆盖了...</span>
			</a>
			<span class="blog_title_box oneline ">
									<span class="type-show type-show-blog type-show-after">博文</span>
											<a target="_blank" rel="noopener" href="https://blog.csdn.net/weixin_37998647">来自：	<span class="blog_title"> 大圣欲何的博客</span></a>
												</span>
		</p>
	</div>
	</div>

	
	
<div class="recommend-item-box type_blog clearfix"  data-report-click='{"mod":"popu_387","dest":"https://blog.csdn.net/huaxiawudi/article/details/81144818","strategy":"BlogCommendFromMachineLearnPai2","index":"3"}'>
	<div class="content">
		<a href="https://blog.csdn.net/huaxiawudi/article/details/81144818" target="_blank"  rel="noopener" title="【Python精华】100个Python练手小程序(Python3  已亲测)">
		<h4 class="text-truncate oneline">
				【<em>Python</em>精华】100个<em>Python</em>练手小程序(<em>Python</em>3  已亲测)		</h4>
		<div class="info-box d-flex align-content-center">
			<p class="date-and-readNum oneline">
				<span class="date hover-show">07-21</span>
				<span class="read-num hover-hide">
					阅读数 
					8970</span>
				</p>
			</div>
		</a>
		<p class="content">
			<a href="https://blog.csdn.net/huaxiawudi/article/details/81144818" target="_blank" rel="noopener" title="【Python精华】100个Python练手小程序(Python3  已亲测)">
				<span class="desc oneline">100个Python练手小程序，学习python的很好的资料，覆盖了python中的每一部分，可以边学习边练习，更容易掌握python。【程序1】 题目：有1、2、3、4个数字，能组成多少个互不相同且...</span>
			</a>
			<span class="blog_title_box oneline ">
									<span class="type-show type-show-blog type-show-after">博文</span>
											<a target="_blank" rel="noopener" href="https://blog.csdn.net/huaxiawudi">来自：	<span class="blog_title"> huaxiawudi的博客</span></a>
												</span>
		</p>
	</div>
	</div>

	<div class="recommend-item-box recommend-recommend-box"><div id="kp_box_59" data-pid="59"><script type="text/javascript">
    (function() {
        var s = "_" + Math.random().toString(36).slice(2);
        document.write('<div style="" id="' + s + '"></div>');
        (window.slotbydup = window.slotbydup || []).push({
            id: "u3491668",
            container:  s
        });
    })();
</script>
<!-- 多条广告如下脚本只需引入一次 -->
<script type="text/javascript" src="//cpro.baidustatic.com/cpro/ui/c.js" async="async" defer="defer" ></script><img class="pre-img-lasy" data-src="https://kunyu.csdn.net/1.png?p=59&a=78&c=0&k=&d=1&t=3&u=b859d272d4e0470398d03bdae3492398"></div></div>
	
<div class="recommend-item-box type_blog clearfix"  data-report-click='{"mod":"popu_387","dest":"https://blog.csdn.net/qq_35527032/article/details/81023121","strategy":"BlogCommendFromMachineLearnPai2","index":"4"}'>
	<div class="content">
		<a href="https://blog.csdn.net/qq_35527032/article/details/81023121" target="_blank"  rel="noopener" title="几个好玩有趣的Python入门实例">
		<h4 class="text-truncate oneline">
				几个好玩有趣的<em>Python</em><em>入门</em><em>实例</em>		</h4>
		<div class="info-box d-flex align-content-center">
			<p class="date-and-readNum oneline">
				<span class="date hover-show">07-12</span>
				<span class="read-num hover-hide">
					阅读数 
					1万+</span>
				</p>
			</div>
		</a>
		<p class="content">
			<a href="https://blog.csdn.net/qq_35527032/article/details/81023121" target="_blank" rel="noopener" title="几个好玩有趣的Python入门实例">
				<span class="desc oneline">几个简单的Python实例，好玩有趣，基础语法。turtle库开始自己的绘画写一个属于自己的文本进度条蒙特卡洛方法计算π分形几何，Koch雪花曲线输入一组数据，进行简单的统计小说词频统计，统计三国演义...</span>
			</a>
			<span class="blog_title_box oneline ">
									<span class="type-show type-show-blog type-show-after">博文</span>
											<a target="_blank" rel="noopener" href="https://blog.csdn.net/qq_35527032">来自：	<span class="blog_title"> Tiko.T的部落格</span></a>
												</span>
		</p>
	</div>
	</div>

	
	
<div class="recommend-item-box type_blog clearfix"  data-report-click='{"mod":"popu_387","dest":"https://blog.csdn.net/fanren224/article/details/72817028","strategy":"BlogCommendFromMachineLearnPai2","index":"5"}'>
	<div class="content">
		<a href="https://blog.csdn.net/fanren224/article/details/72817028" target="_blank"  rel="noopener" title="python3爬虫超简单实例">
		<h4 class="text-truncate oneline">
				<em>python</em>3爬虫超简单<em>实例</em>		</h4>
		<div class="info-box d-flex align-content-center">
			<p class="date-and-readNum oneline">
				<span class="date hover-show">05-31</span>
				<span class="read-num hover-hide">
					阅读数 
					8397</span>
				</p>
			</div>
		</a>
		<p class="content">
			<a href="https://blog.csdn.net/fanren224/article/details/72817028" target="_blank" rel="noopener" title="python3爬虫超简单实例">
				<span class="desc oneline">网站入口：http://wise.xmu.edu.cn/people/faculty爬取信息：姓名和主页地址importrequestsr=requests.get('http://www.wise....</span>
			</a>
			<span class="blog_title_box oneline ">
									<span class="type-show type-show-blog type-show-after">博文</span>
											<a target="_blank" rel="noopener" href="https://blog.csdn.net/fanren224">来自：	<span class="blog_title"> fanren224的博客</span></a>
												</span>
		</p>
	</div>
	</div>

	
	
<div class="recommend-item-box type_blog clearfix"  data-report-click='{"mod":"popu_387","dest":"https://blog.csdn.net/u014044812/article/details/100563668","strategy":"BlogCommendFromMachineLearnPai2","index":"6"}'>
	<div class="content">
		<a href="https://blog.csdn.net/u014044812/article/details/100563668" target="_blank"  rel="noopener" title="Python爬取淘宝商品信息">
		<h4 class="text-truncate oneline">
				<em>Python</em>爬取淘宝商品信息		</h4>
		<div class="info-box d-flex align-content-center">
			<p class="date-and-readNum oneline">
				<span class="date hover-show">09-06</span>
				<span class="read-num hover-hide">
					阅读数 
					8877</span>
				</p>
			</div>
		</a>
		<p class="content">
			<a href="https://blog.csdn.net/u014044812/article/details/100563668" target="_blank" rel="noopener" title="Python爬取淘宝商品信息">
				<span class="desc oneline">各位同学们，好久没写原创技术文章了，最近有些忙，所以进度很慢。警告：本教程仅用作学习交流，请勿用作商业盈利，违者后果自负！如本文有侵犯任何组织集团公司的隐私或利益，请告知联系猪哥删除！！！一、淘宝登录...</span>
			</a>
			<span class="blog_title_box oneline ">
									<span class="type-show type-show-blog type-show-after">博文</span>
											<a target="_blank" rel="noopener" href="https://blog.csdn.net/u014044812">来自：	<span class="blog_title"> 猪哥</span></a>
												</span>
		</p>
	</div>
	</div>

	
	
<div class="recommend-item-box type_blog clearfix"  data-report-click='{"mod":"popu_387","dest":"https://blog.csdn.net/x851288986/article/details/102455899","strategy":"BlogCommendFromMachineLearnPai2","index":"7"}'>
	<div class="content">
		<a href="https://blog.csdn.net/x851288986/article/details/102455899" target="_blank"  rel="noopener" title="程序员真是太太太太太有趣了！！！">
		<h4 class="text-truncate oneline">
				程序员真是太太太太太有趣了！！！		</h4>
		<div class="info-box d-flex align-content-center">
			<p class="date-and-readNum oneline">
				<span class="date hover-show">08-26</span>
				<span class="read-num hover-hide">
					阅读数 
					8742</span>
				</p>
			</div>
		</a>
		<p class="content">
			<a href="https://blog.csdn.net/x851288986/article/details/102455899" target="_blank" rel="noopener" title="程序员真是太太太太太有趣了！！！">
				<span class="desc oneline">点击上方“程序员小明”，选择“星标”今晚可以不加班！网络上虽然已经有了很多关于程序员的话题，但大部分人对这个群体还是很陌生。我们在谈论程序员的时候，究竟该聊些什么呢？各位......</span>
			</a>
			<span class="blog_title_box oneline ">
									<span class="type-show type-show-blog type-show-after">博文</span>
											<a target="_blank" rel="noopener" href="https://blog.csdn.net/x851288986">来自：	<span class="blog_title"> 程序员小明</span></a>
												</span>
		</p>
	</div>
	</div>

	
	
<div class="recommend-item-box type_blog clearfix"  data-report-click='{"mod":"popu_387","dest":"https://blog.csdn.net/easylife206/article/details/100516028","strategy":"BlogCommendFromMachineLearnPai2","index":"8"}'>
	<div class="content">
		<a href="https://blog.csdn.net/easylife206/article/details/100516028" target="_blank"  rel="noopener" title="史上最全的后端技术大全，你都了解哪些技术呢？">
		<h4 class="text-truncate oneline">
				史上最全的后端技术大全，你都了解哪些技术呢？		</h4>
		<div class="info-box d-flex align-content-center">
			<p class="date-and-readNum oneline">
				<span class="date hover-show">09-03</span>
				<span class="read-num hover-hide">
					阅读数 
					1万+</span>
				</p>
			</div>
		</a>
		<p class="content">
			<a href="https://blog.csdn.net/easylife206/article/details/100516028" target="_blank" rel="noopener" title="史上最全的后端技术大全，你都了解哪些技术呢？">
				<span class="desc oneline">|导语工欲善其事，必先利其器；士欲宣其义，必先读其书。后台开发作为互联网技术领域的掌上明珠，一直都是开发者们的追逐的高峰。本文将从后台开发所涉及到的技术术语出发，基于......</span>
			</a>
			<span class="blog_title_box oneline ">
									<span class="type-show type-show-blog type-show-after">博文</span>
											<a target="_blank" rel="noopener" href="https://blog.csdn.net/easylife206">来自：	<span class="blog_title"> easylife206的专栏</span></a>
												</span>
		</p>
	</div>
	</div>

	<div class="recommend-item-box recommend-recommend-box"><div id="kp_box_60" data-pid="60"><div id="three_ad8" class="mediav_ad" ></div>
<script type="text/javascript" src="//static.mediav.com/js/mvf_news_feed.js"></script>
<script>
                                               NEWS_FEED({
                w: 900,
                h : 84,
                showid : 'Afihld',
                placeholderId: "three_ad8",
                inject : 'define',
                define : {
                    imagePosition : 'left',
                    imageBorderRadius : 3,
                    imageWidth: 90,
                    imageHeight: 60,
                    imageFill : 'clip',
                    displayImage : true,
                    displayTitle : true,
                    titleFontSize: 18,
                    titleFontColor: '#000',
                    titleFontFamily : 'Lato,-apple-system,SF UI Text,Arial,PingFang SC,Hiragino Sans GB,Microsoft YaHei,WenQuanYi Micro Hei,sans-serif',
                    titleFontWeight: 'bold',
                    titlePaddingTop : 0,
                    titlePaddingRight : 0,
                    titlePaddingBottom : 5,
                    titlePaddingLeft : 16,
                    displayDesc : true,
                    descFontSize: 14,
                    descFontColor: '#8e959a',
                    descFontFamily : 'Microsoft Yahei',
                    paddingTop : 10,
                    paddingRight : 0,
                    paddingBottom : 0,
                    paddingLeft : 0,
                    backgroundColor: '#fff',
                    hoverColor: '#000'
                      }
                  })
                                        </script><img class="pre-img-lasy" data-src="https://kunyu.csdn.net/1.png?p=60&a=43&c=0&k=&d=1&t=3&u=1f9ff3908a714101a6bdabca766cbc7d"></div></div>
	
<div class="recommend-item-box type_blog clearfix"  data-report-click='{"mod":"popu_387","dest":"https://blog.csdn.net/kexuanxiu1163/article/details/100165991","strategy":"BlogCommendFromMachineLearnPai2","index":"9"}'>
	<div class="content">
		<a href="https://blog.csdn.net/kexuanxiu1163/article/details/100165991" target="_blank"  rel="noopener" title="记一道字节跳动的算法面试题">
		<h4 class="text-truncate oneline">
				记一道字节跳动的算法面试题		</h4>
		<div class="info-box d-flex align-content-center">
			<p class="date-and-readNum oneline">
				<span class="date hover-show">08-30</span>
				<span class="read-num hover-hide">
					阅读数 
					1万+</span>
				</p>
			</div>
		</a>
		<p class="content">
			<a href="https://blog.csdn.net/kexuanxiu1163/article/details/100165991" target="_blank" rel="noopener" title="记一道字节跳动的算法面试题">
				<span class="desc oneline">点击蓝色“五分钟学算法”关注我哟加个“星标”，天天中午12:15，一起学算法作者|帅地来源公众号|苦逼的码农前几天有个朋友去面试字节跳动，面试官问了他一道链表相......</span>
			</a>
			<span class="blog_title_box oneline ">
									<span class="type-show type-show-blog type-show-after">博文</span>
											<a target="_blank" rel="noopener" href="https://blog.csdn.net/kexuanxiu1163">来自：	<span class="blog_title"> 程序员吴师兄的博客</span></a>
												</span>
		</p>
	</div>
	</div>

	
	
<div class="recommend-item-box type_blog clearfix"  data-report-click='{"mod":"popu_387","dest":"https://blog.csdn.net/m0_38106923/article/details/100603516","strategy":"BlogCommendFromMachineLearnPai2","index":"10"}'>
	<div class="content">
		<a href="https://blog.csdn.net/m0_38106923/article/details/100603516" target="_blank"  rel="noopener" title="1行Python代码制作动态二维码">
		<h4 class="text-truncate oneline">
				1行<em>Python</em>代码制作动态二维码		</h4>
		<div class="info-box d-flex align-content-center">
			<p class="date-and-readNum oneline">
				<span class="date hover-show">09-07</span>
				<span class="read-num hover-hide">
					阅读数 
					1万+</span>
				</p>
			</div>
		</a>
		<p class="content">
			<a href="https://blog.csdn.net/m0_38106923/article/details/100603516" target="_blank" rel="noopener" title="1行Python代码制作动态二维码">
				<span class="desc oneline">目录1、普通二维码2、艺术二维码3、动态二维码在GitHub上发现了一个比较有意思的项目，只需要一行Python代码就可以快捷方便生成普通二维码、艺术二维码(黑白/彩色)和动态GIF二维码。GitHu...</span>
			</a>
			<span class="blog_title_box oneline ">
									<span class="type-show type-show-blog type-show-after">博文</span>
											<a target="_blank" rel="noopener" href="https://blog.csdn.net/m0_38106923">来自：	<span class="blog_title"> 不脱发的程序猿</span></a>
												</span>
		</p>
	</div>
	</div>

	
			<div class="recommend-item-box blog-expert-recommend-box">
			<div class="d-flex">
				<div class="blog-expert-recommend">
					<div class="blog-expert">
						<div class="blog-expert-flexbox"></div>
					</div>
				</div>
			</div>
		</div>
	
<div class="recommend-item-box type_blog clearfix"  data-report-click='{"mod":"popu_387","dest":"https://blog.csdn.net/qing_gee/article/details/100559919","strategy":"BlogCommendFromMachineLearnPai2","index":"11"}'>
	<div class="content">
		<a href="https://blog.csdn.net/qing_gee/article/details/100559919" target="_blank"  rel="noopener" title="吃人的那些 Java 名词：对象、引用、堆、栈">
		<h4 class="text-truncate oneline">
				吃人的那些 Java 名词：对象、引用、堆、栈		</h4>
		<div class="info-box d-flex align-content-center">
			<p class="date-and-readNum oneline">
				<span class="date hover-show">09-05</span>
				<span class="read-num hover-hide">
					阅读数 
					1万+</span>
				</p>
			</div>
		</a>
		<p class="content">
			<a href="https://blog.csdn.net/qing_gee/article/details/100559919" target="_blank" rel="noopener" title="吃人的那些 Java 名词：对象、引用、堆、栈">
				<span class="desc oneline">作为一个有着8年Java编程经验的IT老兵，说起来很惭愧，我被Java当中的四五个名词一直困扰着：**对象、引用、堆、栈、堆栈**（栈可同堆栈，因此是四个名词，也是五个名词）。每次我看到这几个名词，都...</span>
			</a>
			<span class="blog_title_box oneline ">
									<span class="type-show type-show-blog type-show-after">博文</span>
											<a target="_blank" rel="noopener" href="https://blog.csdn.net/qing_gee">来自：	<span class="blog_title"> 沉默王二</span></a>
												</span>
		</p>
	</div>
	</div>

	
	
<div class="recommend-item-box type_blog clearfix"  data-report-click='{"mod":"popu_387","dest":"https://blog.csdn.net/u012702547/article/details/100533763","strategy":"BlogCommendFromMachineLearnPai2","index":"12"}'>
	<div class="content">
		<a href="https://blog.csdn.net/u012702547/article/details/100533763" target="_blank"  rel="noopener" title="浏览 GitHub 太卡了？教你两招！">
		<h4 class="text-truncate oneline">
				浏览 GitHub 太卡了？教你两招！		</h4>
		<div class="info-box d-flex align-content-center">
			<p class="date-and-readNum oneline">
				<span class="date hover-show">09-04</span>
				<span class="read-num hover-hide">
					阅读数 
					2万+</span>
				</p>
			</div>
		</a>
		<p class="content">
			<a href="https://blog.csdn.net/u012702547/article/details/100533763" target="_blank" rel="noopener" title="浏览 GitHub 太卡了？教你两招！">
				<span class="desc oneline">老实说，GitHub在国内的使用体验并不算太好，这其中最大的原因就是网络了。GitHub访问起来比较卡，这个看起来貌似无解。国内的gitee网速倒是可以，但是无法代替GitHub，个人感觉gitee上...</span>
			</a>
			<span class="blog_title_box oneline ">
									<span class="type-show type-show-blog type-show-after">博文</span>
											<a target="_blank" rel="noopener" href="https://blog.csdn.net/u012702547">来自：	<span class="blog_title"> 江南一点雨的专栏</span></a>
												</span>
		</p>
	</div>
	</div>

	
	
<div class="recommend-item-box type_blog clearfix"  data-report-click='{"mod":"popu_387","dest":"https://blog.csdn.net/tswc_byy/article/details/81213658","strategy":"BlogCommendFromMachineLearnPai2","index":"13"}'>
	<div class="content">
		<a href="https://blog.csdn.net/tswc_byy/article/details/81213658" target="_blank"  rel="noopener" title="Python 3.7.0 笔记（不完整）">
		<h4 class="text-truncate oneline">
				<em>Python</em> 3.7.0 笔记（不<em>完整</em>）		</h4>
		<div class="info-box d-flex align-content-center">
			<p class="date-and-readNum oneline">
				<span class="date hover-show">07-26</span>
				<span class="read-num hover-hide">
					阅读数 
					3302</span>
				</p>
			</div>
		</a>
		<p class="content">
			<a href="https://blog.csdn.net/tswc_byy/article/details/81213658" target="_blank" rel="noopener" title="Python 3.7.0 笔记（不完整）">
				<span class="desc oneline">目录码仙励志基本输出正确输出错误输出运算操作字符串操作Python第一个小游戏（猜数字游戏）版本1.0版本2.0Python中关键字breakcontinuePython中常用方法input()dir...</span>
			</a>
			<span class="blog_title_box oneline ">
									<span class="type-show type-show-blog type-show-after">博文</span>
											<a target="_blank" rel="noopener" href="https://blog.csdn.net/tswc_byy">来自：	<span class="blog_title"> 秦哥的博客</span></a>
												</span>
		</p>
	</div>
	</div>

	<div class="recommend-item-box recommend-recommend-box"><div id="kp_box_61" data-pid="61"><iframe  src="https://adaccount.csdn.net/#/preview/794?m=pAbSSLJtJpcfbLAiivALpLLHDLDtcJAHcUyUHSnXJbpcLtSHyLpbSofpLJJtAbHQWitpQomnpEnEEQmnpvSfSSnbcJHciQLEnJbQ&k=" frameborder="0" width= "100%"  height= "75px" scrolling="no" ></iframe><img class="pre-img-lasy" data-src="https://kunyu.csdn.net/1.png?d=2&k=&m=pAbSSLJtJpcfbLAiivALpLLHDLDtcJAHcUyUHSnXJbpcLtSHyLpbSofpLJJtAbHQWitpQomnpEnEEQmnpvSfSSnbcJHciQLEnJbQ"></div></div>
	
<div class="recommend-item-box type_blog clearfix"  data-report-click='{"mod":"popu_387","dest":"https://blog.csdn.net/sinat_33224091/article/details/100645137","strategy":"BlogCommendFromMachineLearnPai2","index":"14"}'>
	<div class="content">
		<a href="https://blog.csdn.net/sinat_33224091/article/details/100645137" target="_blank"  rel="noopener" title="全球最厉害的 14 位程序员！">
		<h4 class="text-truncate oneline">
				全球最厉害的 14 位程序员！		</h4>
		<div class="info-box d-flex align-content-center">
			<p class="date-and-readNum oneline">
				<span class="date hover-show">09-08</span>
				<span class="read-num hover-hide">
					阅读数 
					1万+</span>
				</p>
			</div>
		</a>
		<p class="content">
			<a href="https://blog.csdn.net/sinat_33224091/article/details/100645137" target="_blank" rel="noopener" title="全球最厉害的 14 位程序员！">
				<span class="desc oneline">来源|ITWorld整理自网络全球最厉害的14位程序员是谁？今天就让我们一起来了解一下吧，排名不分先后。01.JonSkeet个人名望：程序技术问答网站S......</span>
			</a>
			<span class="blog_title_box oneline ">
									<span class="type-show type-show-blog type-show-after">博文</span>
											<a target="_blank" rel="noopener" href="https://blog.csdn.net/sinat_33224091">来自：	<span class="blog_title"> GitHubDaily</span></a>
												</span>
		</p>
	</div>
	</div>

	
	
<div class="recommend-item-box type_blog clearfix"  data-report-click='{"mod":"popu_387","dest":"https://blog.csdn.net/m0_38103873/article/details/80509113","strategy":"BlogCommendFromMachineLearnPai2","index":"15"}'>
	<div class="content">
		<a href="https://blog.csdn.net/m0_38103873/article/details/80509113" target="_blank"  rel="noopener" title="Python 编写几个经典例子">
		<h4 class="text-truncate oneline">
				<em>Python</em> 编写几个经典例子		</h4>
		<div class="info-box d-flex align-content-center">
			<p class="date-and-readNum oneline">
				<span class="date hover-show">05-30</span>
				<span class="read-num hover-hide">
					阅读数 
					3万+</span>
				</p>
			</div>
		</a>
		<p class="content">
			<a href="https://blog.csdn.net/m0_38103873/article/details/80509113" target="_blank" rel="noopener" title="Python 编写几个经典例子">
				<span class="desc oneline">#九九乘法表foriinrange(1,10):forjinrange(1,i+1):print(&amp;quot;%d*%d=%d\t&amp;quot;%(j,i,i*j),end=&amp;quot;&amp;quot;)p...</span>
			</a>
			<span class="blog_title_box oneline ">
									<span class="type-show type-show-blog type-show-after">博文</span>
											<a target="_blank" rel="noopener" href="https://blog.csdn.net/m0_38103873">来自：	<span class="blog_title"> 三岁牧羊的博客</span></a>
												</span>
		</p>
	</div>
	</div>

	
	
<div class="recommend-item-box type_blog clearfix"  data-report-click='{"mod":"popu_387","dest":"https://blog.csdn.net/qq_44543508/article/details/100192558","strategy":"BlogCommendFromMachineLearnPai2","index":"16"}'>
	<div class="content">
		<a href="https://blog.csdn.net/qq_44543508/article/details/100192558" target="_blank"  rel="noopener" title="史上最详细的IDEA优雅整合Maven+SSM框架（详细思路+附带源码）">
		<h4 class="text-truncate oneline">
				史上最详细的IDEA优雅整合Maven+SSM框架（详细思路+附带源码）		</h4>
		<div class="info-box d-flex align-content-center">
			<p class="date-and-readNum oneline">
				<span class="date hover-show">10-29</span>
				<span class="read-num hover-hide">
					阅读数 
					3万+</span>
				</p>
			</div>
		</a>
		<p class="content">
			<a href="https://blog.csdn.net/qq_44543508/article/details/100192558" target="_blank" rel="noopener" title="史上最详细的IDEA优雅整合Maven+SSM框架（详细思路+附带源码）">
				<span class="desc oneline">网上很多整合SSM博客文章并不能让初探ssm的同学思路完全的清晰，可以试着关掉整合教程，摇两下头骨，哈一大口气，就在万事具备的时候，开整，这个时候你可能思路全无~中招了咩~，还有一些同学依旧在使用ec...</span>
			</a>
			<span class="blog_title_box oneline ">
									<span class="type-show type-show-blog type-show-after">博文</span>
											<a target="_blank" rel="noopener" href="https://blog.csdn.net/qq_44543508">来自：	<span class="blog_title"> 程序员宜春的博客</span></a>
												</span>
		</p>
	</div>
	</div>

	
	
<div class="recommend-item-box type_blog clearfix"  data-report-click='{"mod":"popu_387","dest":"https://blog.csdn.net/weixin_37615279/article/details/100516311","strategy":"BlogCommendFromMachineLearnPai2","index":"17"}'>
	<div class="content">
		<a href="https://blog.csdn.net/weixin_37615279/article/details/100516311" target="_blank"  rel="noopener" title="我的 Input框 不可能这么可爱">
		<h4 class="text-truncate oneline">
				我的 Input框 不可能这么可爱		</h4>
		<div class="info-box d-flex align-content-center">
			<p class="date-and-readNum oneline">
				<span class="date hover-show">09-03</span>
				<span class="read-num hover-hide">
					阅读数 
					8798</span>
				</p>
			</div>
		</a>
		<p class="content">
			<a href="https://blog.csdn.net/weixin_37615279/article/details/100516311" target="_blank" rel="noopener" title="我的 Input框 不可能这么可爱">
				<span class="desc oneline">作者：陈大鱼头github：KRISACHAN&amp;lt;input/&amp;gt;标签是我们日常开发中非常常见的替换元素了，但是最近在刷whattwg跟MDN的时候发现跟&amp;lt;input/&amp;gt;有很多相关...</span>
			</a>
			<span class="blog_title_box oneline ">
									<span class="type-show type-show-blog type-show-after">博文</span>
											<a target="_blank" rel="noopener" href="https://blog.csdn.net/weixin_37615279">来自：	<span class="blog_title"> 鱼头的Web海洋</span></a>
												</span>
		</p>
	</div>
	</div>

	
	
<div class="recommend-item-box type_blog clearfix"  data-report-click='{"mod":"popu_387","dest":"https://blog.csdn.net/qq_42453117/article/details/100036347","strategy":"BlogCommendFromMachineLearnPai2","index":"18"}'>
	<div class="content">
		<a href="https://blog.csdn.net/qq_42453117/article/details/100036347" target="_blank"  rel="noopener" title="程序员那些必须掌握的排序算法(下)">
		<h4 class="text-truncate oneline">
				程序员那些必须掌握的排序算法(下)		</h4>
		<div class="info-box d-flex align-content-center">
			<p class="date-and-readNum oneline">
				<span class="date hover-show">08-25</span>
				<span class="read-num hover-hide">
					阅读数 
					1万+</span>
				</p>
			</div>
		</a>
		<p class="content">
			<a href="https://blog.csdn.net/qq_42453117/article/details/100036347" target="_blank" rel="noopener" title="程序员那些必须掌握的排序算法(下)">
				<span class="desc oneline">接着上一篇的排序算法，我们废话不多，直接进入主题。1.快速排序快速排序（Quicksort）是对冒泡排序的一种改进。快速排序由C.A.R.Hoare在1960年提出。它的基本思想是：通过一趟排序将要排...</span>
			</a>
			<span class="blog_title_box oneline ">
									<span class="type-show type-show-blog type-show-after">博文</span>
											<a target="_blank" rel="noopener" href="https://blog.csdn.net/qq_42453117">来自：	<span class="blog_title"> wangweijun</span></a>
												</span>
		</p>
	</div>
	</div>

	<div class="recommend-item-box recommend-recommend-box"><div id="kp_box_62" data-pid="62"><iframe  src="https://adaccount.csdn.net/#/preview/575?m=LnpiJcQtbvLSHLbiccJtnpyEJJLLHnJpLtcDDnAcAiHtXJDHSJLpvpyJpvJHtLQWtQoLLJSncEibAiUQbctLESJcnSyHnincEQAQ&k=" frameborder="0" width= "100%"  height= "75px" scrolling="no" ></iframe><img class="pre-img-lasy" data-src="https://kunyu.csdn.net/1.png?d=2&k=&m=LnpiJcQtbvLSHLbiccJtnpyEJJLLHnJpLtcDDnAcAiHtXJDHSJLpvpyJpvJHtLQWtQoLLJSncEibAiUQbctLESJcnSyHnincEQAQ"></div></div>
	
<div class="recommend-item-box type_blog clearfix"  data-report-click='{"mod":"popu_387","dest":"https://blog.csdn.net/qq_40693171/article/details/100716766","strategy":"BlogCommendFromMachineLearnPai2","index":"19"}'>
	<div class="content">
		<a href="https://blog.csdn.net/qq_40693171/article/details/100716766" target="_blank"  rel="noopener" title="我花了一夜用数据结构给女朋友写个H5走迷宫游戏">
		<h4 class="text-truncate oneline">
				我花了一夜用数据结构给女朋友写个H5走迷宫游戏		</h4>
		<div class="info-box d-flex align-content-center">
			<p class="date-and-readNum oneline">
				<span class="date hover-show">09-21</span>
				<span class="read-num hover-hide">
					阅读数 
					16万+</span>
				</p>
			</div>
		</a>
		<p class="content">
			<a href="https://blog.csdn.net/qq_40693171/article/details/100716766" target="_blank" rel="noopener" title="我花了一夜用数据结构给女朋友写个H5走迷宫游戏">
				<span class="desc oneline">起因又到深夜了，我按照以往在csdn和公众号写着数据结构！这占用了我大量的时间！我的超越妹妹严重缺乏陪伴而怨气满满！而女朋友时常埋怨，认为数据结构这么抽象难懂的东西没啥作用，常会问道：天天写这玩意，有...</span>
			</a>
			<span class="blog_title_box oneline ">
									<span class="type-show type-show-blog type-show-after">博文</span>
											<a target="_blank" rel="noopener" href="https://blog.csdn.net/qq_40693171">来自：	<span class="blog_title"> bigsai</span></a>
												</span>
		</p>
	</div>
	</div>

	
	
<div class="recommend-item-box type_blog clearfix"  data-report-click='{"mod":"popu_387","dest":"https://blog.csdn.net/qq_36903042/article/details/100798101","strategy":"BlogCommendFromMachineLearnPai2","index":"20"}'>
	<div class="content">
		<a href="https://blog.csdn.net/qq_36903042/article/details/100798101" target="_blank"  rel="noopener" title="别再翻了，面试二叉树看这 11 个就够了~">
		<h4 class="text-truncate oneline">
				别再翻了，面试二叉树看这 11 个就够了~		</h4>
		<div class="info-box d-flex align-content-center">
			<p class="date-and-readNum oneline">
				<span class="date hover-show">09-13</span>
				<span class="read-num hover-hide">
					阅读数 
					6万+</span>
				</p>
			</div>
		</a>
		<p class="content">
			<a href="https://blog.csdn.net/qq_36903042/article/details/100798101" target="_blank" rel="noopener" title="别再翻了，面试二叉树看这 11 个就够了~">
				<span class="desc oneline">写在前边数据结构与算法：不知道你有没有这种困惑，虽然刷了很多算法题，当我去面试的时候，面试官让你手写一个算法，可能你对此算法很熟悉，知道实现思路，但是总是不知道该在什么地方写，而且很多边界条件想不全面...</span>
			</a>
			<span class="blog_title_box oneline ">
									<span class="type-show type-show-blog type-show-after">博文</span>
											<a target="_blank" rel="noopener" href="https://blog.csdn.net/qq_36903042">来自：	<span class="blog_title"> 一个不甘平凡的码农</span></a>
												</span>
		</p>
	</div>
	</div>

	
	
<div class="recommend-item-box type_blog clearfix"  data-report-click='{"mod":"popu_387","dest":"https://blog.csdn.net/csdnnews/article/details/100987866","strategy":"BlogCommendFromMachineLearnPai2","index":"21"}'>
	<div class="content">
		<a href="https://blog.csdn.net/csdnnews/article/details/100987866" target="_blank"  rel="noopener" title="阿里资深工程师教你如何优化 Java 代码！">
		<h4 class="text-truncate oneline">
				阿里资深工程师教你如何优化 Java 代码！		</h4>
		<div class="info-box d-flex align-content-center">
			<p class="date-and-readNum oneline">
				<span class="date hover-show">09-17</span>
				<span class="read-num hover-hide">
					阅读数 
					2万+</span>
				</p>
			</div>
		</a>
		<p class="content">
			<a href="https://blog.csdn.net/csdnnews/article/details/100987866" target="_blank" rel="noopener" title="阿里资深工程师教你如何优化 Java 代码！">
				<span class="desc oneline">作者|王超责编|伍杏玲明代王阳明先生在《传习录》谈为学之道时说：私欲日生，如地上尘，一日不扫，便又有一层。着实用功，便见道无终穷，愈探愈深，必使精白无一毫不彻方可。代码中的&quot;坏味道&quot;，如&quot;私欲&quot;如&quot;灰...</span>
			</a>
			<span class="blog_title_box oneline ">
									<span class="type-show type-show-blog type-show-after">博文</span>
											<a target="_blank" rel="noopener" href="https://blog.csdn.net/csdnnews">来自：	<span class="blog_title"> CSDN资讯</span></a>
												</span>
		</p>
	</div>
	</div>

	
	
<div class="recommend-item-box type_blog clearfix"  data-report-click='{"mod":"popu_387","dest":"https://blog.csdn.net/z694644032/article/details/100084287","strategy":"BlogCommendFromMachineLearnPai2","index":"22"}'>
	<div class="content">
		<a href="https://blog.csdn.net/z694644032/article/details/100084287" target="_blank"  rel="noopener" title="学会了这些技术，你离BAT大厂不远了">
		<h4 class="text-truncate oneline">
				学会了这些技术，你离BAT大厂不远了		</h4>
		<div class="info-box d-flex align-content-center">
			<p class="date-and-readNum oneline">
				<span class="date hover-show">08-26</span>
				<span class="read-num hover-hide">
					阅读数 
					15万+</span>
				</p>
			</div>
		</a>
		<p class="content">
			<a href="https://blog.csdn.net/z694644032/article/details/100084287" target="_blank" rel="noopener" title="学会了这些技术，你离BAT大厂不远了">
				<span class="desc oneline">每一个程序员都有一个梦想，梦想着能够进入阿里、腾讯、字节跳动、百度等一线互联网公司，由于身边的环境等原因，不知道 BAT 等一线互联网公司使用哪些技术？或者该如何去学习这些技术？或者我该去哪些获取这些...</span>
			</a>
			<span class="blog_title_box oneline ">
									<span class="type-show type-show-blog type-show-after">博文</span>
											<a target="_blank" rel="noopener" href="https://blog.csdn.net/z694644032">来自：	<span class="blog_title"> 平头哥的技术博文</span></a>
												</span>
		</p>
	</div>
	</div>

	
	
<div class="recommend-item-box type_blog clearfix"  data-report-click='{"mod":"popu_387","dest":"https://blog.csdn.net/csdnnews/article/details/100695399","strategy":"BlogCommendFromMachineLearnPai2","index":"23"}'>
	<div class="content">
		<a href="https://blog.csdn.net/csdnnews/article/details/100695399" target="_blank"  rel="noopener" title="Google 为中国开发者都带来了什么？">
		<h4 class="text-truncate oneline">
				Google 为中国开发者都带来了什么？		</h4>
		<div class="info-box d-flex align-content-center">
			<p class="date-and-readNum oneline">
				<span class="date hover-show">09-10</span>
				<span class="read-num hover-hide">
					阅读数 
					3703</span>
				</p>
			</div>
		</a>
		<p class="content">
			<a href="https://blog.csdn.net/csdnnews/article/details/100695399" target="_blank" rel="noopener" title="Google 为中国开发者都带来了什么？">
				<span class="desc oneline">Android10原生支持5G，Flutter1.9、Dart2.5正式发布！作者|唐小引写于上海世博中心封图|CSDN付费下载自东方IC出品|GDD合作伙伴CSDN（ID：CSDNnews）这是Go...</span>
			</a>
			<span class="blog_title_box oneline ">
									<span class="type-show type-show-blog type-show-after">博文</span>
											<a target="_blank" rel="noopener" href="https://blog.csdn.net/csdnnews">来自：	<span class="blog_title"> CSDN资讯</span></a>
												</span>
		</p>
	</div>
	</div>

	<div class="recommend-item-box recommend-recommend-box"><div id="kp_box_63" data-pid="63"><iframe  src="https://adaccount.csdn.net/#/preview/758?m=AcnfEiJbAiSJASJELvbHnEbbSbtSnDtcUHcnALnSEpALnALUfcHiXtULHiyvEEmAEHbQWbctQiLAbmbfnnniboLfDSAbSftHcQbQ&k=" frameborder="0" width= "100%"  height= "75px" scrolling="no" ></iframe><img class="pre-img-lasy" data-src="https://kunyu.csdn.net/1.png?d=2&k=&m=AcnfEiJbAiSJASJELvbHnEbbSbtSnDtcUHcnALnSEpALnALUfcHiXtULHiyvEEmAEHbQWbctQiLAbmbfnnniboLfDSAbSftHcQbQ"></div></div>
	
<div class="recommend-item-box type_blog clearfix"  data-report-click='{"mod":"popu_387","dest":"https://blog.csdn.net/csdnnews/article/details/100815497","strategy":"BlogCommendFromMachineLearnPai2","index":"24"}'>
	<div class="content">
		<a href="https://blog.csdn.net/csdnnews/article/details/100815497" target="_blank"  rel="noopener" title="不识 Pandas，纵是老手也枉然？">
		<h4 class="text-truncate oneline">
				不识 Pandas，纵是老手也枉然？		</h4>
		<div class="info-box d-flex align-content-center">
			<p class="date-and-readNum oneline">
				<span class="date hover-show">09-13</span>
				<span class="read-num hover-hide">
					阅读数 
					3378</span>
				</p>
			</div>
		</a>
		<p class="content">
			<a href="https://blog.csdn.net/csdnnews/article/details/100815497" target="_blank" rel="noopener" title="不识 Pandas，纵是老手也枉然？">
				<span class="desc oneline">作者|周志鹏责编|郭芮这段时间和一些做数据分析的同学闲聊，我发现数据分析技能入门阶段存在一个普遍性的问题，很多凭着兴趣入坑的同学，都能够很快熟悉Python基础语法，然后不约而同的一头扎进《利用Pyt...</span>
			</a>
			<span class="blog_title_box oneline ">
									<span class="type-show type-show-blog type-show-after">博文</span>
											<a target="_blank" rel="noopener" href="https://blog.csdn.net/csdnnews">来自：	<span class="blog_title"> CSDN资讯</span></a>
												</span>
		</p>
	</div>
	</div>

	
	
<div class="recommend-item-box type_blog clearfix"  data-report-click='{"mod":"popu_387","dest":"https://blog.csdn.net/BEYONDMA/article/details/100799830","strategy":"BlogCommendFromMachineLearnPai2","index":"25"}'>
	<div class="content">
		<a href="https://blog.csdn.net/BEYONDMA/article/details/100799830" target="_blank"  rel="noopener" title="盘点那些被AI换脸、一键“脱”衣所滥用的AI模型">
		<h4 class="text-truncate oneline">
				盘点那些被AI换脸、一键“脱”衣所滥用的AI模型		</h4>
		<div class="info-box d-flex align-content-center">
			<p class="date-and-readNum oneline">
				<span class="date hover-show">09-21</span>
				<span class="read-num hover-hide">
					阅读数 
					1万+</span>
				</p>
			</div>
		</a>
		<p class="content">
			<a href="https://blog.csdn.net/BEYONDMA/article/details/100799830" target="_blank" rel="noopener" title="盘点那些被AI换脸、一键“脱”衣所滥用的AI模型">
				<span class="desc oneline">上周作者发布了一篇有关AI换脸的教程，不过令笔者始料未及的是一石激起千层浪，竟然有不少网友留言求所谓一键“脱”衣的教程。虽然笔者对于技术的滥用深恶痛绝，但技术本身是中性的，并无好坏之分，从我上篇博文中...</span>
			</a>
			<span class="blog_title_box oneline ">
									<span class="type-show type-show-blog type-show-after">博文</span>
											<a target="_blank" rel="noopener" href="https://blog.csdn.net/BEYONDMA">来自：	<span class="blog_title"> Python爱好者的专栏</span></a>
												</span>
		</p>
	</div>
	</div>

	
	
<div class="recommend-item-box type_blog clearfix"  data-report-click='{"mod":"popu_387","dest":"https://blog.csdn.net/M2l0ZgSsVc7r69eFdTj/article/details/100773494","strategy":"BlogCommendFromMachineLearnPai2","index":"26"}'>
	<div class="content">
		<a href="https://blog.csdn.net/M2l0ZgSsVc7r69eFdTj/article/details/100773494" target="_blank"  rel="noopener" title="团队中的 Git 实践">
		<h4 class="text-truncate oneline">
				团队中的 Git 实践		</h4>
		<div class="info-box d-flex align-content-center">
			<p class="date-and-readNum oneline">
				<span class="date hover-show">09-12</span>
				<span class="read-num hover-hide">
					阅读数 
					3057</span>
				</p>
			</div>
		</a>
		<p class="content">
			<a href="https://blog.csdn.net/M2l0ZgSsVc7r69eFdTj/article/details/100773494" target="_blank" rel="noopener" title="团队中的 Git 实践">
				<span class="desc oneline">在2005年的某一天，Linux之父LinusTorvalds发布了他的又一个里程碑作品——Git。它的出现改变了软件开发流程，大大地提高了开发流畅度！直到现......</span>
			</a>
			<span class="blog_title_box oneline ">
									<span class="type-show type-show-blog type-show-after">博文</span>
											<a target="_blank" rel="noopener" href="https://blog.csdn.net/M2l0ZgSsVc7r69eFdTj">来自：	<span class="blog_title"> Docker的专栏</span></a>
												</span>
		</p>
	</div>
	</div>

	
	
<div class="recommend-item-box type_blog clearfix"  data-report-click='{"mod":"popu_387","dest":"https://blog.csdn.net/kexuanxiu1163/article/details/100840644","strategy":"BlogCommendFromMachineLearnPai2","index":"27"}'>
	<div class="content">
		<a href="https://blog.csdn.net/kexuanxiu1163/article/details/100840644" target="_blank"  rel="noopener" title="五分钟小知识：为什么说 ++i 的效率比 i++ 高？">
		<h4 class="text-truncate oneline">
				五分钟小知识：为什么说 ++i 的效率比 i++ 高？		</h4>
		<div class="info-box d-flex align-content-center">
			<p class="date-and-readNum oneline">
				<span class="date hover-show">09-14</span>
				<span class="read-num hover-hide">
					阅读数 
					4682</span>
				</p>
			</div>
		</a>
		<p class="content">
			<a href="https://blog.csdn.net/kexuanxiu1163/article/details/100840644" target="_blank" rel="noopener" title="五分钟小知识：为什么说 ++i 的效率比 i++ 高？">
				<span class="desc oneline">点击蓝色“五分钟学算法”关注我哟加个“星标”，天天中午 12:15，一起学算法作者 | 守望先生来源 | 编程珠玑前言不知道你是否听说过 ++i 比 i++ 快的说法，真......</span>
			</a>
			<span class="blog_title_box oneline ">
									<span class="type-show type-show-blog type-show-after">博文</span>
											<a target="_blank" rel="noopener" href="https://blog.csdn.net/kexuanxiu1163">来自：	<span class="blog_title"> 程序员吴师兄的博客</span></a>
												</span>
		</p>
	</div>
	</div>

	
	
<div class="recommend-item-box type_blog clearfix"  data-report-click='{"mod":"popu_387","dest":"https://blog.csdn.net/TeFuirnever/article/details/100700212","strategy":"BlogCommendFromMachineLearnPai2","index":"28"}'>
	<div class="content">
		<a href="https://blog.csdn.net/TeFuirnever/article/details/100700212" target="_blank"  rel="noopener" title="《C++ Primer》学习笔记/习题答案 总目录">
		<h4 class="text-truncate oneline">
				《C++ Primer》学习笔记/习题答案 总目录		</h4>
		<div class="info-box d-flex align-content-center">
			<p class="date-and-readNum oneline">
				<span class="date hover-show">09-10</span>
				<span class="read-num hover-hide">
					阅读数 
					9577</span>
				</p>
			</div>
		</a>
		<p class="content">
			<a href="https://blog.csdn.net/TeFuirnever/article/details/100700212" target="_blank" rel="noopener" title="《C++ Primer》学习笔记/习题答案 总目录">
				<span class="desc oneline">文章目录前言专栏C++学习笔记目录第一章 - 快速入门第二章 - 变量和基本类型第三章 - 标准库类型第四章 - 数组和指针第五章 - 表达式第六章 - 语句第七章 - 函数第八章 - 标准 IO 库...</span>
			</a>
			<span class="blog_title_box oneline ">
									<span class="type-show type-show-blog type-show-after">博文</span>
											<a target="_blank" rel="noopener" href="https://blog.csdn.net/TeFuirnever">来自：	<span class="blog_title"> 种树最好的时间是10年前，其次是现在！！！</span></a>
												</span>
		</p>
	</div>
	</div>

	<div class="recommend-item-box recommend-recommend-box"><div id="kp_box_64" data-pid="64"><div id="three_ad28" class="mediav_ad" ></div>
<script type="text/javascript" src="//static.mediav.com/js/mvf_news_feed.js"></script>
<script>
                                               NEWS_FEED({
                w: 852,
                h : 60,
                showid : 'Afihld',
                placeholderId: "three_ad28",
                inject : 'define',
                define : {
                    imagePosition : 'left',
                    imageBorderRadius : 3,
                    imageWidth: 90,
                    imageHeight: 60,
                    imageFill : 'clip',
                    displayImage : true,
                    displayTitle : true,
                    titleFontSize: 18,
                    titleFontColor: '#000',
                    titleFontFamily : 'Lato,-apple-system,SF UI Text,Arial,PingFang SC,Hiragino Sans GB,Microsoft YaHei,WenQuanYi Micro Hei,sans-serif',
                    titleFontWeight: 'bold',
                    titlePaddingTop : 0,
                    titlePaddingRight : 0,
                    titlePaddingBottom : 5,
                    titlePaddingLeft : 16,
                    displayDesc : true,
                    descFontSize: 14,
                    descFontColor: '#8e959a',
                    descFontFamily : 'Microsoft Yahei',
                    paddingTop : 0,
                    paddingRight : 0,
                    paddingBottom : 0,
                    paddingLeft : 0,
                    backgroundColor: '#fff',
                    hoverColor: '#000'
                      }
                  })
                                        </script><img class="pre-img-lasy" data-src="https://kunyu.csdn.net/1.png?p=64&a=81&c=0&k=&d=1&t=3&u=1494a40090764f7c8301a554cd752064"></div></div>
	
<div class="recommend-item-box type_blog clearfix"  data-report-click='{"mod":"popu_387","dest":"https://blog.csdn.net/caoz/article/details/100681599","strategy":"BlogCommendFromMachineLearnPai2","index":"29"}'>
	<div class="content">
		<a href="https://blog.csdn.net/caoz/article/details/100681599" target="_blank"  rel="noopener" title="二十出头，老气横秋">
		<h4 class="text-truncate oneline">
				二十出头，老气横秋		</h4>
		<div class="info-box d-flex align-content-center">
			<p class="date-and-readNum oneline">
				<span class="date hover-show">09-09</span>
				<span class="read-num hover-hide">
					阅读数 
					4908</span>
				</p>
			</div>
		</a>
		<p class="content">
			<a href="https://blog.csdn.net/caoz/article/details/100681599" target="_blank" rel="noopener" title="二十出头，老气横秋">
				<span class="desc oneline">有的时候，我们希望年轻人成熟一点，不要巨婴，不要总是等着别人来解救，要自立，要有担当。但有时候吧，发现有些年轻人，似乎过于成熟了，二十来岁的人，感觉怎么就老气横秋的。1、......</span>
			</a>
			<span class="blog_title_box oneline ">
									<span class="type-show type-show-blog type-show-after">博文</span>
											<a target="_blank" rel="noopener" href="https://blog.csdn.net/caoz">来自：	<span class="blog_title"> caoz的梦呓</span></a>
												</span>
		</p>
	</div>
	</div>

	
	
<div class="recommend-item-box type_blog clearfix"  data-report-click='{"mod":"popu_387","dest":"https://blog.csdn.net/csdnnews/article/details/100976779","strategy":"BlogCommendFromMachineLearnPai2","index":"30"}'>
	<div class="content">
		<a href="https://blog.csdn.net/csdnnews/article/details/100976779" target="_blank"  rel="noopener" title="鸿蒙 OS 的到来，能为我们改变什么？">
		<h4 class="text-truncate oneline">
				鸿蒙 OS 的到来，能为我们改变什么？		</h4>
		<div class="info-box d-flex align-content-center">
			<p class="date-and-readNum oneline">
				<span class="date hover-show">09-18</span>
				<span class="read-num hover-hide">
					阅读数 
					3万+</span>
				</p>
			</div>
		</a>
		<p class="content">
			<a href="https://blog.csdn.net/csdnnews/article/details/100976779" target="_blank" rel="noopener" title="鸿蒙 OS 的到来，能为我们改变什么？">
				<span class="desc oneline">作者|屠敏出品|CSDN（ID：CSDNnews）「鸿蒙初辟原无姓，打破顽空需悟空」，在国产自研操作系统短缺的窘境之下，天惊一声雷，「鸿蒙」踏风来。回首上个月的技术圈，最值得业界浮称流说的无疑是8月9...</span>
			</a>
			<span class="blog_title_box oneline ">
									<span class="type-show type-show-blog type-show-after">博文</span>
											<a target="_blank" rel="noopener" href="https://blog.csdn.net/csdnnews">来自：	<span class="blog_title"> CSDN资讯</span></a>
												</span>
		</p>
	</div>
	</div>

	
	
<div class="recommend-item-box type_blog clearfix"  data-report-click='{"mod":"popu_387","dest":"https://blog.csdn.net/BF02jgtRS00XKtCx/article/details/80863669","strategy":"BlogCommendFromMachineLearnPai2","index":"31"}'>
	<div class="content">
		<a href="https://blog.csdn.net/BF02jgtRS00XKtCx/article/details/80863669" target="_blank"  rel="noopener" title="Python 3.7.0 版本正式发布，新特性来袭">
		<h4 class="text-truncate oneline">
				<em>Python</em> 3.7.0 <em>版本</em>正式发布，新特性来袭		</h4>
		<div class="info-box d-flex align-content-center">
			<p class="date-and-readNum oneline">
				<span class="date hover-show">06-29</span>
				<span class="read-num hover-hide">
					阅读数 
					1万+</span>
				</p>
			</div>
		</a>
		<p class="content">
			<a href="https://blog.csdn.net/BF02jgtRS00XKtCx/article/details/80863669" target="_blank" rel="noopener" title="Python 3.7.0 版本正式发布，新特性来袭">
				<span class="desc oneline">Python3.7.0版本已经于美国时间2018年6月27日发布，同时发布的也有Python3.6.6版本，下面是来自Python官网的通知：我们代表Python开发......</span>
			</a>
			<span class="blog_title_box oneline ">
									<span class="type-show type-show-blog type-show-after">博文</span>
											<a target="_blank" rel="noopener" href="https://blog.csdn.net/BF02jgtRS00XKtCx">来自：	<span class="blog_title"> Python中文社区</span></a>
												</span>
		</p>
	</div>
	</div>

	
	
<div class="recommend-item-box type_blog clearfix"  data-report-click='{"mod":"popu_387","dest":"https://blog.csdn.net/xili2532/article/details/96570505","strategy":"BlogCommendFromMachineLearnPai2","index":"32"}'>
	<div class="content">
		<a href="https://blog.csdn.net/xili2532/article/details/96570505" target="_blank"  rel="noopener" title="解读python3.7教程">
		<h4 class="text-truncate oneline">
				解读<em>python</em>3.7教程		</h4>
		<div class="info-box d-flex align-content-center">
			<p class="date-and-readNum oneline">
				<span class="date hover-show">07-20</span>
				<span class="read-num hover-hide">
					阅读数 
					138</span>
				</p>
			</div>
		</a>
		<p class="content">
			<a href="https://blog.csdn.net/xili2532/article/details/96570505" target="_blank" rel="noopener" title="解读python3.7教程">
				<span class="desc oneline">一 . 变量 字符串的操作1.在交互式模式中，打印的表达式的结果赋给变量_， 在交互模式中 _ 代表一个待赋值的变量，打印的话是一个空的字符串，每当交互模式中有新的结果，则这个结果也就赋值给 ‘_’,...</span>
			</a>
			<span class="blog_title_box oneline ">
									<span class="type-show type-show-blog type-show-after">博文</span>
											<a target="_blank" rel="noopener" href="https://blog.csdn.net/xili2532">来自：	<span class="blog_title"> Shallow的博客</span></a>
												</span>
		</p>
	</div>
	</div>

	
	
<div class="recommend-item-box type_blog clearfix"  data-report-click='{"mod":"popu_387","dest":"https://blog.csdn.net/qq_39492932/article/details/100786991","strategy":"BlogCommendFromMachineLearnPai2","index":"33"}'>
	<div class="content">
		<a href="https://blog.csdn.net/qq_39492932/article/details/100786991" target="_blank"  rel="noopener" title="【电赛】2019电赛纸张计数显示装置（F题）">
		<h4 class="text-truncate oneline">
				【电赛】2019电赛纸张计数显示装置（F题）		</h4>
		<div class="info-box d-flex align-content-center">
			<p class="date-and-readNum oneline">
				<span class="date hover-show">10-24</span>
				<span class="read-num hover-hide">
					阅读数 
					3828</span>
				</p>
			</div>
		</a>
		<p class="content">
			<a href="https://blog.csdn.net/qq_39492932/article/details/100786991" target="_blank" rel="noopener" title="【电赛】2019电赛纸张计数显示装置（F题）">
				<span class="desc oneline">2019年全国大学生电子设计竞赛纸张计数显示装置（F题）【本科组】[外链图片转存失败(img-9bk1h47P-1568302010340)(https://github.com/zengwangfa...</span>
			</a>
			<span class="blog_title_box oneline ">
									<span class="type-show type-show-blog type-show-after">博文</span>
											<a target="_blank" rel="noopener" href="https://blog.csdn.net/qq_39492932">来自：	<span class="blog_title"> 淹死的鱼</span></a>
												</span>
		</p>
	</div>
	</div>

	<div class="recommend-item-box recommend-recommend-box"><div id="kp_box_65" data-pid="65"><div id="three_ad33" class="mediav_ad" ></div>
<script>
                                               NEWS_FEED({
                w: 852,
                h : 60,
                showid : 'GNKXx7',
                placeholderId: "three_ad33",
                inject : 'define',
                define : {
                    imagePosition : 'left',
                    imageBorderRadius : 3,
                    imageWidth: 90,
                    imageHeight: 60,
                    imageFill : 'clip',
                    displayImage : true,
                    displayTitle : true,
                    titleFontSize: 18,
                    titleFontColor: '#000',
                    titleFontFamily : 'Lato,-apple-system,SF UI Text,Arial,PingFang SC,Hiragino Sans GB,Microsoft YaHei,WenQuanYi Micro Hei,sans-serif',
                    titleFontWeight: 'bold',
                    titlePaddingTop : 0,
                    titlePaddingRight : 0,
                    titlePaddingBottom : 5,
                    titlePaddingLeft : 16,
                    displayDesc : true,
                    descFontSize: 14,
                    descFontColor: '#8e959a',
                    descFontFamily : 'Microsoft Yahei',
                    paddingTop : 0,
                    paddingRight : 0,
                    paddingBottom : 0,
                    paddingLeft : 0,
                    backgroundColor: '#fff',
                    hoverColor: '#000'
                      }
                  })
                                        </script><img class="pre-img-lasy" data-src="https://kunyu.csdn.net/1.png?p=65&a=84&c=0&k=&d=1&t=3&u=701242b51d14436996bc59dd7e4aba71"></div></div>
	
<div class="recommend-item-box type_blog clearfix"  data-report-click='{"mod":"popu_387","dest":"https://blog.csdn.net/ljk126wy/article/details/101064186","strategy":"BlogCommendFromMachineLearnPai2","index":"34"}'>
	<div class="content">
		<a href="https://blog.csdn.net/ljk126wy/article/details/101064186" target="_blank"  rel="noopener" title="Git 天天用 但是 Git 原理你了解吗？">
		<h4 class="text-truncate oneline">
				Git 天天用 但是 Git 原理你了解吗？		</h4>
		<div class="info-box d-flex align-content-center">
			<p class="date-and-readNum oneline">
				<span class="date hover-show">09-20</span>
				<span class="read-num hover-hide">
					阅读数 
					2万+</span>
				</p>
			</div>
		</a>
		<p class="content">
			<a href="https://blog.csdn.net/ljk126wy/article/details/101064186" target="_blank" rel="noopener" title="Git 天天用 但是 Git 原理你了解吗？">
				<span class="desc oneline">Git原理做技术一定要知其然知其所以然，意思就是：知道它是这样的，更知道它为什么是这样的。我主要通过4块内容来简单介绍Git是原理是什么样的。这4块内容如下：Git存储目录结构介绍Git是如何存储的G...</span>
			</a>
			<span class="blog_title_box oneline ">
									<span class="type-show type-show-blog type-show-after">博文</span>
											<a target="_blank" rel="noopener" href="https://blog.csdn.net/ljk126wy">来自：	<span class="blog_title"> ljk126wy的博客</span></a>
												</span>
		</p>
	</div>
	</div>

	
	
<div class="recommend-item-box type_blog clearfix"  data-report-click='{"mod":"popu_387","dest":"https://blog.csdn.net/DiDi_Tech/article/details/100806477","strategy":"BlogCommendFromMachineLearnPai2","index":"35"}'>
	<div class="content">
		<a href="https://blog.csdn.net/DiDi_Tech/article/details/100806477" target="_blank"  rel="noopener" title="浅谈滴滴派单算法">
		<h4 class="text-truncate oneline">
				浅谈滴滴派单算法		</h4>
		<div class="info-box d-flex align-content-center">
			<p class="date-and-readNum oneline">
				<span class="date hover-show">09-13</span>
				<span class="read-num hover-hide">
					阅读数 
					1万+</span>
				</p>
			</div>
		</a>
		<p class="content">
			<a href="https://blog.csdn.net/DiDi_Tech/article/details/100806477" target="_blank" rel="noopener" title="浅谈滴滴派单算法">
				<span class="desc oneline">本文作者：王犇滴滴|首席算法工程师导读：说到滴滴的派单算法，大家可能感觉到既神秘又好奇，从出租车扬召到司机在滴滴平台抢单最后到平台派单，大家今天的出行体验已经发生了翻天覆地的变化，面对着每天数千万的呼...</span>
			</a>
			<span class="blog_title_box oneline ">
									<span class="type-show type-show-blog type-show-after">博文</span>
											<a target="_blank" rel="noopener" href="https://blog.csdn.net/DiDi_Tech">来自：	<span class="blog_title"> DiDi_Tech的博客</span></a>
												</span>
		</p>
	</div>
	</div>

	
	
<div class="recommend-item-box type_blog clearfix"  data-report-click='{"mod":"popu_387","dest":"https://blog.csdn.net/qq_36664495/article/details/82794525","strategy":"BlogCommendFromMachineLearnPai2","index":"36"}'>
	<div class="content">
		<a href="https://blog.csdn.net/qq_36664495/article/details/82794525" target="_blank"  rel="noopener" title="Python小例子（一）">
		<h4 class="text-truncate oneline">
				<em>Python</em>小例子（一）		</h4>
		<div class="info-box d-flex align-content-center">
			<p class="date-and-readNum oneline">
				<span class="date hover-show">09-20</span>
				<span class="read-num hover-hide">
					阅读数 
					4132</span>
				</p>
			</div>
		</a>
		<p class="content">
			<a href="https://blog.csdn.net/qq_36664495/article/details/82794525" target="_blank" rel="noopener" title="Python小例子（一）">
				<span class="desc oneline">1.根据半径r计算圆半径r=25area=3.1415*r*rprint(area)print(&amp;quot;{:.2f}&amp;quot;.format(area))2.绘制同心圆importturtlet...</span>
			</a>
			<span class="blog_title_box oneline ">
									<span class="type-show type-show-blog type-show-after">博文</span>
											<a target="_blank" rel="noopener" href="https://blog.csdn.net/qq_36664495">来自：	<span class="blog_title"> 望生帝的博客</span></a>
												</span>
		</p>
	</div>
	</div>

	
	
<div class="recommend-item-box type_blog clearfix"  data-report-click='{"mod":"popu_387","dest":"https://blog.csdn.net/kexuanxiu1163/article/details/100869719","strategy":"BlogCommendFromMachineLearnPai2","index":"37"}'>
	<div class="content">
		<a href="https://blog.csdn.net/kexuanxiu1163/article/details/100869719" target="_blank"  rel="noopener" title="什么是大公司病（太形象了）">
		<h4 class="text-truncate oneline">
				什么是大公司病（太形象了）		</h4>
		<div class="info-box d-flex align-content-center">
			<p class="date-and-readNum oneline">
				<span class="date hover-show">09-15</span>
				<span class="read-num hover-hide">
					阅读数 
					1万+</span>
				</p>
			</div>
		</a>
		<p class="content">
			<a href="https://blog.csdn.net/kexuanxiu1163/article/details/100869719" target="_blank" rel="noopener" title="什么是大公司病（太形象了）">
				<span class="desc oneline">点击蓝色“五分钟学算法”关注我哟加个“星标”，天天中午12:15，一起学算法作者|南之鱼来源|芝麻观点（chinamkt）所谓大企业病，一般都具有机构臃肿、多重......</span>
			</a>
			<span class="blog_title_box oneline ">
									<span class="type-show type-show-blog type-show-after">博文</span>
											<a target="_blank" rel="noopener" href="https://blog.csdn.net/kexuanxiu1163">来自：	<span class="blog_title"> 程序员吴师兄的博客</span></a>
												</span>
		</p>
	</div>
	</div>

	
	
<div class="recommend-item-box type_blog clearfix"  data-report-click='{"mod":"popu_387","dest":"https://blog.csdn.net/CSDN___LYY/article/details/100584638","strategy":"BlogCommendFromMachineLearnPai2","index":"38"}'>
	<div class="content">
		<a href="https://blog.csdn.net/CSDN___LYY/article/details/100584638" target="_blank"  rel="noopener" title="shell-【技术干货】工作中编写shell脚本实践">
		<h4 class="text-truncate oneline">
				shell-【技术干货】工作中编写shell脚本实践		</h4>
		<div class="info-box d-flex align-content-center">
			<p class="date-and-readNum oneline">
				<span class="date hover-show">09-06</span>
				<span class="read-num hover-hide">
					阅读数 
					2万+</span>
				</p>
			</div>
		</a>
		<p class="content">
			<a href="https://blog.csdn.net/CSDN___LYY/article/details/100584638" target="_blank" rel="noopener" title="shell-【技术干货】工作中编写shell脚本实践">
				<span class="desc oneline">在公司项目的开发过程中，需要编写shell脚本去处理一个业务，在编写过程中发现自身对shell脚本的知识不够完善，顾整理一下，本文章主要内容来自菜鸟教程,也添加了一些知识点shell脚本？在说什么是s...</span>
			</a>
			<span class="blog_title_box oneline ">
									<span class="type-show type-show-blog type-show-after">博文</span>
											<a target="_blank" rel="noopener" href="https://blog.csdn.net/CSDN___LYY">来自：	<span class="blog_title"> web洋仔</span></a>
												</span>
		</p>
	</div>
	</div>

	<div class="recommend-item-box recommend-recommend-box"><div id="kp_box_66" data-pid="66"><div id="three_ad38" class="mediav_ad" ></div>
<script>
                                               NEWS_FEED({
                w: 852,
                h : 60,
                showid : 'Afihld',
                placeholderId: "three_ad38",
                inject : 'define',
                define : {
                    imagePosition : 'left',
                    imageBorderRadius : 3,
                    imageWidth: 90,
                    imageHeight: 60,
                    imageFill : 'clip',
                    displayImage : true,
                    displayTitle : true,
                    titleFontSize: 18,
                    titleFontColor: '#000',
                    titleFontFamily : 'Lato,-apple-system,SF UI Text,Arial,PingFang SC,Hiragino Sans GB,Microsoft YaHei,WenQuanYi Micro Hei,sans-serif',
                    titleFontWeight: 'bold',
                    titlePaddingTop : 0,
                    titlePaddingRight : 0,
                    titlePaddingBottom : 5,
                    titlePaddingLeft : 16,
                    displayDesc : true,
                    descFontSize: 14,
                    descFontColor: '#8e959a',
                    descFontFamily : 'Microsoft Yahei',
                    paddingTop : 0,
                    paddingRight : 0,
                    paddingBottom : 0,
                    paddingLeft : 0,
                    backgroundColor: '#fff',
                    hoverColor: '#000'
                      }
                  })
                                        </script><img class="pre-img-lasy" data-src="https://kunyu.csdn.net/1.png?p=66&a=87&c=0&k=&d=1&t=3&u=c5a029f257b94c16a554f651a254a6cc"></div></div>
	
<div class="recommend-item-box type_blog clearfix"  data-report-click='{"mod":"popu_387","dest":"https://blog.csdn.net/gexiaoyizhimei/article/details/100122368","strategy":"BlogCommendHotData","index":"1"}'>
	<div class="content">
		<a href="https://blog.csdn.net/gexiaoyizhimei/article/details/100122368" target="_blank"  rel="noopener" title="Linux文件操作高频使用命令">
		<h4 class="text-truncate oneline">
				Linux文件操作高频使用命令		</h4>
		<div class="info-box d-flex align-content-center">
			<p class="date-and-readNum oneline">
				<span class="date hover-show">08-28</span>
				<span class="read-num hover-hide">
					阅读数 
					1996</span>
				</p>
			</div>
		</a>
		<p class="content">
			<a href="https://blog.csdn.net/gexiaoyizhimei/article/details/100122368" target="_blank" rel="noopener" title="Linux文件操作高频使用命令">
				<span class="desc oneline">文章目录0.新建操作：1.查看操作2.删除操作3.复制操作4.移动操作：5.重命名操作：6.解压压缩操作
0.新建操作：
mkdir abc #新建一个文件夹
touch abc.sh #新建一...</span>
			</a>
			<span class="blog_title_box oneline no-title">
									<span class="type-show type-show-blog type-show-after">博文</span>
												</span>
		</p>
	</div>
	</div>

	
	
<div class="recommend-item-box type_blog clearfix"  data-report-click='{"mod":"popu_387","dest":"https://blog.csdn.net/m0_38106923/article/details/100130354","strategy":"BlogCommendHotData","index":"2"}'>
	<div class="content">
		<a href="https://blog.csdn.net/m0_38106923/article/details/100130354" target="_blank"  rel="noopener" title="程序员实用工具网站">
		<h4 class="text-truncate oneline">
				程序员实用工具网站		</h4>
		<div class="info-box d-flex align-content-center">
			<p class="date-and-readNum oneline">
				<span class="date hover-show">09-04</span>
				<span class="read-num hover-hide">
					阅读数 
					18万+</span>
				</p>
			</div>
		</a>
		<p class="content">
			<a href="https://blog.csdn.net/m0_38106923/article/details/100130354" target="_blank" rel="noopener" title="程序员实用工具网站">
				<span class="desc oneline">目录

1、搜索引擎

2、PPT

3、图片操作

4、文件共享

5、应届生招聘

6、程序员面试题库

7、办公、开发软件

8、高清图片、视频素材网站

9、项目开源

10、算法

11、在...</span>
			</a>
			<span class="blog_title_box oneline no-title">
									<span class="type-show type-show-blog type-show-after">博文</span>
												</span>
		</p>
	</div>
	</div>

	
	
<div class="recommend-item-box type_blog clearfix"  data-report-click='{"mod":"popu_387","dest":"https://blog.csdn.net/ybhuangfugui/article/details/100913641","strategy":"BlogCommendHotData","index":"7"}'>
	<div class="content">
		<a href="https://blog.csdn.net/ybhuangfugui/article/details/100913641" target="_blank"  rel="noopener" title="让程序员崩溃的瞬间（非程序员勿入）">
		<h4 class="text-truncate oneline">
				让程序员崩溃的瞬间（非程序员勿入）		</h4>
		<div class="info-box d-flex align-content-center">
			<p class="date-and-readNum oneline">
				<span class="date hover-show">09-16</span>
				<span class="read-num hover-hide">
					阅读数 
					22万+</span>
				</p>
			</div>
		</a>
		<p class="content">
			<a href="https://blog.csdn.net/ybhuangfugui/article/details/100913641" target="_blank" rel="noopener" title="让程序员崩溃的瞬间（非程序员勿入）">
				<span class="desc oneline">今天给大家带来点快乐，程序员才能看懂。



来源：https://zhuanlan.zhihu.com/p/47066521




1. 公司实习生找 Bug







2.在调试时，将断点设...</span>
			</a>
			<span class="blog_title_box oneline no-title">
									<span class="type-show type-show-blog type-show-after">博文</span>
												</span>
		</p>
	</div>
	</div>

	
	
<div class="recommend-item-box type_blog clearfix"  data-report-click='{"mod":"popu_387","dest":"https://blog.csdn.net/qq_43371556/article/details/101027046","strategy":"BlogCommendHotData","index":"8"}'>
	<div class="content">
		<a href="https://blog.csdn.net/qq_43371556/article/details/101027046" target="_blank"  rel="noopener" title="Spring高级技术梳理">
		<h4 class="text-truncate oneline">
				Spring高级技术梳理		</h4>
		<div class="info-box d-flex align-content-center">
			<p class="date-and-readNum oneline">
				<span class="date hover-show">09-20</span>
				<span class="read-num hover-hide">
					阅读数 
					3699</span>
				</p>
			</div>
		</a>
		<p class="content">
			<a href="https://blog.csdn.net/qq_43371556/article/details/101027046" target="_blank" rel="noopener" title="Spring高级技术梳理">
				<span class="desc oneline">Spring高级技术梳理   序言正文SpringDate部分Spring全家桶之SpringData——预科阶段Spring全家桶之SpringData——Spring 整合Hibernate与Hi...</span>
			</a>
			<span class="blog_title_box oneline no-title">
									<span class="type-show type-show-blog type-show-after">博文</span>
												</span>
		</p>
	</div>
	</div>

	
	
<div class="recommend-item-box type_blog clearfix"  data-report-click='{"mod":"popu_387","dest":"https://blog.csdn.net/lantian_123/article/details/101488841","strategy":"BlogCommendHotData","index":"10"}'>
	<div class="content">
		<a href="https://blog.csdn.net/lantian_123/article/details/101488841" target="_blank"  rel="noopener" title="分享靠写代码赚钱的一些门路">
		<h4 class="text-truncate oneline">
				分享靠写代码赚钱的一些门路		</h4>
		<div class="info-box d-flex align-content-center">
			<p class="date-and-readNum oneline">
				<span class="date hover-show">09-26</span>
				<span class="read-num hover-hide">
					阅读数 
					5万+</span>
				</p>
			</div>
		</a>
		<p class="content">
			<a href="https://blog.csdn.net/lantian_123/article/details/101488841" target="_blank" rel="noopener" title="分享靠写代码赚钱的一些门路">
				<span class="desc oneline">作者 mezod，译者 josephchang10如今，通过自己的代码去赚钱变得越来越简单，不过对很多人来说依然还是很难，因为他们不知道有哪些门路。今天给大家分享一个精彩......</span>
			</a>
			<span class="blog_title_box oneline no-title">
									<span class="type-show type-show-blog type-show-after">博文</span>
												</span>
		</p>
	</div>
	</div>

	<div class="recommend-item-box recommend-recommend-box"><script type="text/javascript" src="//rabc1.iteye.com/production/res/rxjg.js?pkcgstj=jm"></script></div>
	
<div class="recommend-item-box type_blog clearfix"  data-report-click='{"mod":"popu_387","dest":"https://blog.csdn.net/harvic880925/article/details/101511637","strategy":"BlogCommendHotData","index":"11"}'>
	<div class="content">
		<a href="https://blog.csdn.net/harvic880925/article/details/101511637" target="_blank"  rel="noopener" title="对计算机专业来说学历真的重要吗？">
		<h4 class="text-truncate oneline">
				对计算机专业来说学历真的重要吗？		</h4>
		<div class="info-box d-flex align-content-center">
			<p class="date-and-readNum oneline">
				<span class="date hover-show">09-27</span>
				<span class="read-num hover-hide">
					阅读数 
					7万+</span>
				</p>
			</div>
		</a>
		<p class="content">
			<a href="https://blog.csdn.net/harvic880925/article/details/101511637" target="_blank" rel="noopener" title="对计算机专业来说学历真的重要吗？">
				<span class="desc oneline">我本科学校是渣渣二本，研究生学校是985，现在毕业五年，校招笔试、面试，社招面试参加了两年了，就我个人的经历来说下这个问题。

这篇文章很长，但绝对是精华，相信我，读完以后，你会知道学历不好的解决方案...</span>
			</a>
			<span class="blog_title_box oneline no-title">
									<span class="type-show type-show-blog type-show-after">博文</span>
												</span>
		</p>
	</div>
	</div>

	
	
<div class="recommend-item-box type_blog clearfix"  data-report-click='{"mod":"popu_387","dest":"https://blog.csdn.net/lantian_123/article/details/101514976","strategy":"BlogCommendHotData","index":"12"}'>
	<div class="content">
		<a href="https://blog.csdn.net/lantian_123/article/details/101514976" target="_blank"  rel="noopener" title="技术人员要拿百万年薪，必须要经历这9个段位">
		<h4 class="text-truncate oneline">
				技术人员要拿百万年薪，必须要经历这9个段位		</h4>
		<div class="info-box d-flex align-content-center">
			<p class="date-and-readNum oneline">
				<span class="date hover-show">08-24</span>
				<span class="read-num hover-hide">
					阅读数 
					2万+</span>
				</p>
			</div>
		</a>
		<p class="content">
			<a href="https://blog.csdn.net/lantian_123/article/details/101514976" target="_blank" rel="noopener" title="技术人员要拿百万年薪，必须要经历这9个段位">
				<span class="desc oneline">很多人都问，技术人员如何成长，每个阶段又是怎样的，如何才能走出当前的迷茫，实现自我的突破。所以我结合我自己10多年的从业经验，总结了技术人员成长的9个段位，希望对大家的职......</span>
			</a>
			<span class="blog_title_box oneline no-title">
									<span class="type-show type-show-blog type-show-after">博文</span>
												</span>
		</p>
	</div>
	</div>

	
	
<div class="recommend-item-box type_blog clearfix"  data-report-click='{"mod":"popu_387","dest":"https://blog.csdn.net/foruok/article/details/101678953","strategy":"BlogCommendHotData","index":"13"}'>
	<div class="content">
		<a href="https://blog.csdn.net/foruok/article/details/101678953" target="_blank"  rel="noopener" title="8000字干货：那些很厉害的人是怎么构建知识体系的">
		<h4 class="text-truncate oneline">
				8000字干货：那些很厉害的人是怎么构建知识体系的		</h4>
		<div class="info-box d-flex align-content-center">
			<p class="date-and-readNum oneline">
				<span class="date hover-show">09-29</span>
				<span class="read-num hover-hide">
					阅读数 
					4万+</span>
				</p>
			</div>
		</a>
		<p class="content">
			<a href="https://blog.csdn.net/foruok/article/details/101678953" target="_blank" rel="noopener" title="8000字干货：那些很厉害的人是怎么构建知识体系的">
				<span class="desc oneline">本文约8000字，正常阅读需要15~20分钟。读完本文可以获得如下收益：

分辨知识和知识体系的差别
理解如何用八大问发现知识的连接点；
掌握致用类知识体系的构建方法；
能够应用甜蜜区模型找到特定领域...</span>
			</a>
			<span class="blog_title_box oneline no-title">
									<span class="type-show type-show-blog type-show-after">博文</span>
												</span>
		</p>
	</div>
	</div>

	
	
<div class="recommend-item-box type_blog clearfix"  data-report-click='{"mod":"popu_387","dest":"https://blog.csdn.net/qq_40036754/article/details/102463099","strategy":"BlogCommendHotData","index":"14"}'>
	<div class="content">
		<a href="https://blog.csdn.net/qq_40036754/article/details/102463099" target="_blank"  rel="noopener" title="nginx学习，看这一篇就够了：下载、安装。使用：正向代理、反向代理、负载均衡。常用命令和配置文件">
		<h4 class="text-truncate oneline">
				nginx学习，看这一篇就够了：下载、安装。使用：正向代理、反向代理、负载均衡。常用命令和配置文件		</h4>
		<div class="info-box d-flex align-content-center">
			<p class="date-and-readNum oneline">
				<span class="date hover-show">10-25</span>
				<span class="read-num hover-hide">
					阅读数 
					7079</span>
				</p>
			</div>
		</a>
		<p class="content">
			<a href="https://blog.csdn.net/qq_40036754/article/details/102463099" target="_blank" rel="noopener" title="nginx学习，看这一篇就够了：下载、安装。使用：正向代理、反向代理、负载均衡。常用命令和配置文件">
				<span class="desc oneline">文章目录前言一、nginx简介1.  什么是 nginx 和可以做什么事情2.Nginx 作为 web 服务器3. 正向代理4. 反向代理5. 动静分离6.动静分离二、Nginx 的安装三、 Ngin...</span>
			</a>
			<span class="blog_title_box oneline no-title">
									<span class="type-show type-show-blog type-show-after">博文</span>
												</span>
		</p>
	</div>
	</div>

	
	
<div class="recommend-item-box type_blog clearfix"  data-report-click='{"mod":"popu_387","dest":"https://blog.csdn.net/chest_/article/details/102537988","strategy":"BlogCommendHotData","index":"15"}'>
	<div class="content">
		<a href="https://blog.csdn.net/chest_/article/details/102537988" target="_blank"  rel="noopener" title="《漏洞篇》sql注入---入门到进阶">
		<h4 class="text-truncate oneline">
				《漏洞篇》sql注入---入门到进阶		</h4>
		<div class="info-box d-flex align-content-center">
			<p class="date-and-readNum oneline">
				<span class="date hover-show">10-24</span>
				<span class="read-num hover-hide">
					阅读数 
					2043</span>
				</p>
			</div>
		</a>
		<p class="content">
			<a href="https://blog.csdn.net/chest_/article/details/102537988" target="_blank" rel="noopener" title="《漏洞篇》sql注入---入门到进阶">
				<span class="desc oneline">目录导航
sql注入的原理
sql注入的条件
sql注入的危害
sql注入的分类、验证及利用方式
sql数值型注入

sql注入的原理：
概述：针对SQL注入的攻击行为可描述为通过用户可控参数中注入S...</span>
			</a>
			<span class="blog_title_box oneline no-title">
									<span class="type-show type-show-blog type-show-after">博文</span>
												</span>
		</p>
	</div>
	</div>

	<div class="recommend-item-box recommend-recommend-box"><script type="text/javascript" src="//rabc1.iteye.com/production/res/rxjg.js?pkcgstj=jm"></script></div>
	
<div class="recommend-item-box type_blog clearfix"  data-report-click='{"mod":"popu_387","dest":"https://blog.csdn.net/u012365828/article/details/102559913","strategy":"BlogCommendHotData","index":"16"}'>
	<div class="content">
		<a href="https://blog.csdn.net/u012365828/article/details/102559913" target="_blank"  rel="noopener" title="500行代码，教你用python写个微信飞机大战">
		<h4 class="text-truncate oneline">
				500行代码，教你用python写个微信飞机大战		</h4>
		<div class="info-box d-flex align-content-center">
			<p class="date-and-readNum oneline">
				<span class="date hover-show">10-16</span>
				<span class="read-num hover-hide">
					阅读数 
					5万+</span>
				</p>
			</div>
		</a>
		<p class="content">
			<a href="https://blog.csdn.net/u012365828/article/details/102559913" target="_blank" rel="noopener" title="500行代码，教你用python写个微信飞机大战">
				<span class="desc oneline">这几天在重温微信小游戏的飞机大战，玩着玩着就在思考人生了，这飞机大战怎么就可以做的那么好，操作简单，简单上手。

帮助蹲厕族、YP族、饭圈女孩在无聊之余可以有一样东西让他们振作起来！让他们的左手 / ...</span>
			</a>
			<span class="blog_title_box oneline no-title">
									<span class="type-show type-show-blog type-show-after">博文</span>
												</span>
		</p>
	</div>
	</div>

	
	
<div class="recommend-item-box type_blog clearfix"  data-report-click='{"mod":"popu_387","dest":"https://blog.csdn.net/zhongyangzhong/article/details/102578044","strategy":"BlogCommendHotData","index":"17"}'>
	<div class="content">
		<a href="https://blog.csdn.net/zhongyangzhong/article/details/102578044" target="_blank"  rel="noopener" title="2019诺贝尔经济学奖得主：贫穷的本质是什么？">
		<h4 class="text-truncate oneline">
				2019诺贝尔经济学奖得主：贫穷的本质是什么？		</h4>
		<div class="info-box d-flex align-content-center">
			<p class="date-and-readNum oneline">
				<span class="date hover-show">10-15</span>
				<span class="read-num hover-hide">
					阅读数 
					1万+</span>
				</p>
			</div>
		</a>
		<p class="content">
			<a href="https://blog.csdn.net/zhongyangzhong/article/details/102578044" target="_blank" rel="noopener" title="2019诺贝尔经济学奖得主：贫穷的本质是什么？">
				<span class="desc oneline">2019年诺贝尔经济学奖，颁给了来自麻省理工学院的 阿巴希·巴纳吉（Abhijit Vinayak Banerjee）、艾丝特·杜芙若（Esther Duflo）夫妇和哈......</span>
			</a>
			<span class="blog_title_box oneline no-title">
									<span class="type-show type-show-blog type-show-after">博文</span>
												</span>
		</p>
	</div>
	</div>

	
	
<div class="recommend-item-box type_blog clearfix"  data-report-click='{"mod":"popu_387","dest":"https://blog.csdn.net/m0_37907797/article/details/102618796","strategy":"BlogCommendHotData","index":"18"}'>
	<div class="content">
		<a href="https://blog.csdn.net/m0_37907797/article/details/102618796" target="_blank"  rel="noopener" title="别在学习框架了，那些让你起飞的计算机基础知识。">
		<h4 class="text-truncate oneline">
				别在学习框架了，那些让你起飞的计算机基础知识。		</h4>
		<div class="info-box d-flex align-content-center">
			<p class="date-and-readNum oneline">
				<span class="date hover-show">10-22</span>
				<span class="read-num hover-hide">
					阅读数 
					5万+</span>
				</p>
			</div>
		</a>
		<p class="content">
			<a href="https://blog.csdn.net/m0_37907797/article/details/102618796" target="_blank" rel="noopener" title="别在学习框架了，那些让你起飞的计算机基础知识。">
				<span class="desc oneline">我之前里的文章，写的大部分都是与计算机基础知识相关的，这些基础知识，就像我们的内功，如果在未来想要走的更远，这些内功是必须要修炼的。框架千变万化，而这些通用的底层知识，却是几乎不变的，了解了这些知识，...</span>
			</a>
			<span class="blog_title_box oneline no-title">
									<span class="type-show type-show-blog type-show-after">博文</span>
												</span>
		</p>
	</div>
	</div>

	
	
<div class="recommend-item-box type_blog clearfix"  data-report-click='{"mod":"popu_387","dest":"https://blog.csdn.net/qq_37969433/article/details/102637226","strategy":"BlogCommendHotData","index":"19"}'>
	<div class="content">
		<a href="https://blog.csdn.net/qq_37969433/article/details/102637226" target="_blank"  rel="noopener" title="MySQL数据库—SQL汇总">
		<h4 class="text-truncate oneline">
				MySQL数据库—SQL汇总		</h4>
		<div class="info-box d-flex align-content-center">
			<p class="date-and-readNum oneline">
				<span class="date hover-show">10-24</span>
				<span class="read-num hover-hide">
					阅读数 
					1万+</span>
				</p>
			</div>
		</a>
		<p class="content">
			<a href="https://blog.csdn.net/qq_37969433/article/details/102637226" target="_blank" rel="noopener" title="MySQL数据库—SQL汇总">
				<span class="desc oneline">一、准备
下文整理常见SQL语句的用法，使用MySQL5.7测试，参考了尚硅谷MySQL教程及用例。用例sql：
链接: https://pan.baidu.com/s/1tb3-12MRNFjV8d...</span>
			</a>
			<span class="blog_title_box oneline no-title">
									<span class="type-show type-show-blog type-show-after">博文</span>
												</span>
		</p>
	</div>
	</div>

	
	
<div class="recommend-item-box type_blog clearfix"  data-report-click='{"mod":"popu_387","dest":"https://blog.csdn.net/qq_35067322/article/details/102645455","strategy":"BlogCommendHotData","index":"20"}'>
	<div class="content">
		<a href="https://blog.csdn.net/qq_35067322/article/details/102645455" target="_blank"  rel="noopener" title="Spring Boot 2 实战：使用 Spring Boot Admin 监控你的应用">
		<h4 class="text-truncate oneline">
				Spring Boot 2 实战：使用 Spring Boot Admin 监控你的应用		</h4>
		<div class="info-box d-flex align-content-center">
			<p class="date-and-readNum oneline">
				<span class="date hover-show">10-20</span>
				<span class="read-num hover-hide">
					阅读数 
					642</span>
				</p>
			</div>
		</a>
		<p class="content">
			<a href="https://blog.csdn.net/qq_35067322/article/details/102645455" target="_blank" rel="noopener" title="Spring Boot 2 实战：使用 Spring Boot Admin 监控你的应用">
				<span class="desc oneline">1. 前言
生产上对 Web 应用 的监控是十分必要的。我们可以近乎实时来对应用的健康、性能等其他指标进行监控来及时应对一些突发情况。避免一些故障的发生。对于 Spring Boot 应用来说我们可以...</span>
			</a>
			<span class="blog_title_box oneline no-title">
									<span class="type-show type-show-blog type-show-after">博文</span>
												</span>
		</p>
	</div>
	</div>

	
	
<div class="recommend-item-box type_blog clearfix"  data-report-click='{"mod":"popu_387","dest":"https://blog.csdn.net/loongggdroid/article/details/102656177","strategy":"BlogCommendHotData","index":"21"}'>
	<div class="content">
		<a href="https://blog.csdn.net/loongggdroid/article/details/102656177" target="_blank"  rel="noopener" title="五款高效率黑科技神器工具，炸裂好用，省时间">
		<h4 class="text-truncate oneline">
				五款高效率黑科技神器工具，炸裂好用，省时间		</h4>
		<div class="info-box d-flex align-content-center">
			<p class="date-and-readNum oneline">
				<span class="date hover-show">10-20</span>
				<span class="read-num hover-hide">
					阅读数 
					2万+</span>
				</p>
			</div>
		</a>
		<p class="content">
			<a href="https://blog.csdn.net/loongggdroid/article/details/102656177" target="_blank" rel="noopener" title="五款高效率黑科技神器工具，炸裂好用，省时间">
				<span class="desc oneline">loonggg读完需要4分钟速读仅需2分钟感觉我好久好久没有给大家分享高质量的软件和插件了。今天周末，难得在家休息一下，痛下决心，分享一些我认为的高效率工具软件给大家。废......</span>
			</a>
			<span class="blog_title_box oneline no-title">
									<span class="type-show type-show-blog type-show-after">博文</span>
												</span>
		</p>
	</div>
	</div>

	
	
<div class="recommend-item-box type_blog clearfix"  data-report-click='{"mod":"popu_387","dest":"https://blog.csdn.net/qq_36903042/article/details/102656641","strategy":"BlogCommendHotData","index":"22"}'>
	<div class="content">
		<a href="https://blog.csdn.net/qq_36903042/article/details/102656641" target="_blank"  rel="noopener" title="动画：用动画给女朋友讲解 TCP 四次分手过程">
		<h4 class="text-truncate oneline">
				动画：用动画给女朋友讲解 TCP 四次分手过程		</h4>
		<div class="info-box d-flex align-content-center">
			<p class="date-and-readNum oneline">
				<span class="date hover-show">10-21</span>
				<span class="read-num hover-hide">
					阅读数 
					2万+</span>
				</p>
			</div>
		</a>
		<p class="content">
			<a href="https://blog.csdn.net/qq_36903042/article/details/102656641" target="_blank" rel="noopener" title="动画：用动画给女朋友讲解 TCP 四次分手过程">
				<span class="desc oneline">作者 |  小鹿
来源 |  公众号：小鹿动画学编程

写在前边
大家好，我们又见面了，做为一个业余的动画师，上次的用动画的形式讲解 TCP 三次握手过程再各大平台收到了广大读者的喜爱，说文章有趣、有...</span>
			</a>
			<span class="blog_title_box oneline no-title">
									<span class="type-show type-show-blog type-show-after">博文</span>
												</span>
		</p>
	</div>
	</div>

	
	
<div class="recommend-item-box type_blog clearfix"  data-report-click='{"mod":"popu_387","dest":"https://blog.csdn.net/m0_37907797/article/details/102661778","strategy":"BlogCommendHotData","index":"23"}'>
	<div class="content">
		<a href="https://blog.csdn.net/m0_37907797/article/details/102661778" target="_blank"  rel="noopener" title="程序员必须掌握的核心算法有哪些？">
		<h4 class="text-truncate oneline">
				程序员必须掌握的核心算法有哪些？		</h4>
		<div class="info-box d-flex align-content-center">
			<p class="date-and-readNum oneline">
				<span class="date hover-show">10-21</span>
				<span class="read-num hover-hide">
					阅读数 
					6万+</span>
				</p>
			</div>
		</a>
		<p class="content">
			<a href="https://blog.csdn.net/m0_37907797/article/details/102661778" target="_blank" rel="noopener" title="程序员必须掌握的核心算法有哪些？">
				<span class="desc oneline">由于我之前一直强调数据结构以及算法学习的重要性，所以就有一些读者经常问我，数据结构与算法应该要学习到哪个程度呢？，说实话，这个问题我不知道要怎么回答你，主要取决于你想学习到哪些程度，不过针对这个问题，...</span>
			</a>
			<span class="blog_title_box oneline no-title">
									<span class="type-show type-show-blog type-show-after">博文</span>
												</span>
		</p>
	</div>
	</div>

	
	
<div class="recommend-item-box type_blog clearfix"  data-report-click='{"mod":"popu_387","dest":"https://blog.csdn.net/qq_43371556/article/details/102667146","strategy":"BlogCommendHotData","index":"24"}'>
	<div class="content">
		<a href="https://blog.csdn.net/qq_43371556/article/details/102667146" target="_blank"  rel="noopener" title="高并发技术">
		<h4 class="text-truncate oneline">
				高并发技术		</h4>
		<div class="info-box d-flex align-content-center">
			<p class="date-and-readNum oneline">
				<span class="date hover-show">10-24</span>
				<span class="read-num hover-hide">
					阅读数 
					1万+</span>
				</p>
			</div>
		</a>
		<p class="content">
			<a href="https://blog.csdn.net/qq_43371556/article/details/102667146" target="_blank" rel="noopener" title="高并发技术">
				<span class="desc oneline">高并发技术   第一章 预备知识一 理解大数据二 网工基础知识OSI七层参考模型应用层表示层会话层传输层网络层链路层物理层功能分层总结第二章 LVS技术一  LVS介绍二 LVS调度算法LVS命令监控...</span>
			</a>
			<span class="blog_title_box oneline no-title">
									<span class="type-show type-show-blog type-show-after">博文</span>
												</span>
		</p>
	</div>
	</div>

	
	
<div class="recommend-item-box type_blog clearfix"  data-report-click='{"mod":"popu_387","dest":"https://blog.csdn.net/xufive/article/details/102676755","strategy":"BlogCommendHotData","index":"25"}'>
	<div class="content">
		<a href="https://blog.csdn.net/xufive/article/details/102676755" target="_blank"  rel="noopener" title="python 程序员进阶之路：从新手到高手的100个模块">
		<h4 class="text-truncate oneline">
				python 程序员进阶之路：从新手到高手的100个模块		</h4>
		<div class="info-box d-flex align-content-center">
			<p class="date-and-readNum oneline">
				<span class="date hover-show">10-23</span>
				<span class="read-num hover-hide">
					阅读数 
					5万+</span>
				</p>
			</div>
		</a>
		<p class="content">
			<a href="https://blog.csdn.net/xufive/article/details/102676755" target="_blank" rel="noopener" title="python 程序员进阶之路：从新手到高手的100个模块">
				<span class="desc oneline">在知乎和CSDN的圈子里，经常看到、听到一些 python 初学者说，学完基础语法后，不知道该学什么，学了也不知道怎么用，一脸的茫然。近日，CSDN的公众号推送了一篇博客，题目叫做《迷思：Python...</span>
			</a>
			<span class="blog_title_box oneline no-title">
									<span class="type-show type-show-blog type-show-after">博文</span>
												</span>
		</p>
	</div>
	</div>

	
	
<div class="recommend-item-box type_blog clearfix"  data-report-click='{"mod":"popu_387","dest":"https://blog.csdn.net/weixin_43943977/article/details/102691392","strategy":"BlogCommendHotData","index":"26"}'>
	<div class="content">
		<a href="https://blog.csdn.net/weixin_43943977/article/details/102691392" target="_blank"  rel="noopener" title="Python——画一棵漂亮的樱花树（不同种樱花+玫瑰+圣诞树喔）">
		<h4 class="text-truncate oneline">
				Python——画一棵漂亮的樱花树（不同种樱花+玫瑰+圣诞树喔）		</h4>
		<div class="info-box d-flex align-content-center">
			<p class="date-and-readNum oneline">
				<span class="date hover-show">10-22</span>
				<span class="read-num hover-hide">
					阅读数 
					3万+</span>
				</p>
			</div>
		</a>
		<p class="content">
			<a href="https://blog.csdn.net/weixin_43943977/article/details/102691392" target="_blank" rel="noopener" title="Python——画一棵漂亮的樱花树（不同种樱花+玫瑰+圣诞树喔）">
				<span class="desc oneline">最近翻到一篇知乎，上面有不少用Python（大多是turtle库）绘制的树图，感觉很漂亮，我整理了一下，挑了一些我觉得不错的代码分享给大家（这些我都测试过，确实可以生成）
one 樱花树

 动...</span>
			</a>
			<span class="blog_title_box oneline no-title">
									<span class="type-show type-show-blog type-show-after">博文</span>
												</span>
		</p>
	</div>
	</div>

	
	
<div class="recommend-item-box type_blog clearfix"  data-report-click='{"mod":"popu_387","dest":"https://blog.csdn.net/csdnnews/article/details/102693777","strategy":"BlogCommendHotData","index":"27"}'>
	<div class="content">
		<a href="https://blog.csdn.net/csdnnews/article/details/102693777" target="_blank"  rel="noopener" title="程序员不懂浪漫？胡扯！">
		<h4 class="text-truncate oneline">
				程序员不懂浪漫？胡扯！		</h4>
		<div class="info-box d-flex align-content-center">
			<p class="date-and-readNum oneline">
				<span class="date hover-show">10-22</span>
				<span class="read-num hover-hide">
					阅读数 
					2万+</span>
				</p>
			</div>
		</a>
		<p class="content">
			<a href="https://blog.csdn.net/csdnnews/article/details/102693777" target="_blank" rel="noopener" title="程序员不懂浪漫？胡扯！">
				<span class="desc oneline">程序员男朋友你的程序员男朋友为你做过什么暖心的事情呢？我的男朋友是一个程序员，他有很多大家在网络上吐槽的程序员的缺点，比如加班很多，没空陪我吃饭逛街看电影，比如说他有的时......</span>
			</a>
			<span class="blog_title_box oneline no-title">
									<span class="type-show type-show-blog type-show-after">博文</span>
												</span>
		</p>
	</div>
	</div>

	
	
<div class="recommend-item-box type_blog clearfix"  data-report-click='{"mod":"popu_387","dest":"https://blog.csdn.net/lianghecai52171314/article/details/102711958","strategy":"BlogCommendHotData","index":"28"}'>
	<div class="content">
		<a href="https://blog.csdn.net/lianghecai52171314/article/details/102711958" target="_blank"  rel="noopener" title="阿里编程规范（简化版）">
		<h4 class="text-truncate oneline">
				阿里编程规范（简化版）		</h4>
		<div class="info-box d-flex align-content-center">
			<p class="date-and-readNum oneline">
				<span class="date hover-show">10-24</span>
				<span class="read-num hover-hide">
					阅读数 
					2814</span>
				</p>
			</div>
		</a>
		<p class="content">
			<a href="https://blog.csdn.net/lianghecai52171314/article/details/102711958" target="_blank" rel="noopener" title="阿里编程规范（简化版）">
				<span class="desc oneline">阿里编程规范 及 阿里Java开发规约插件 Alibaba Java Coding Guidelines
统一规范标准将有助于提高行业编码规范化水平，帮助行业人员提高开发质量和效率、大大降低代码维护成...</span>
			</a>
			<span class="blog_title_box oneline no-title">
									<span class="type-show type-show-blog type-show-after">博文</span>
												</span>
		</p>
	</div>
	</div>

	
	
<div class="recommend-item-box type_blog clearfix"  data-report-click='{"mod":"popu_387","dest":"https://blog.csdn.net/hyb612/article/details/102730648","strategy":"BlogCommendHotData","index":"29"}'>
	<div class="content">
		<a href="https://blog.csdn.net/hyb612/article/details/102730648" target="_blank"  rel="noopener" title="Linux/C/C++ 不可错过的好书">
		<h4 class="text-truncate oneline">
				Linux/C/C++ 不可错过的好书		</h4>
		<div class="info-box d-flex align-content-center">
			<p class="date-and-readNum oneline">
				<span class="date hover-show">10-24</span>
				<span class="read-num hover-hide">
					阅读数 
					1万+</span>
				</p>
			</div>
		</a>
		<p class="content">
			<a href="https://blog.csdn.net/hyb612/article/details/102730648" target="_blank" rel="noopener" title="Linux/C/C++ 不可错过的好书">
				<span class="desc oneline">来源：公众号【编程珠玑】

作者：守望先生

ID：shouwangxiansheng



前言

经常有读者让我推荐书籍，这次我就把我私藏的计算机书单分享给你们！不过由于时间匆忙，不会进行更加详细...</span>
			</a>
			<span class="blog_title_box oneline no-title">
									<span class="type-show type-show-blog type-show-after">博文</span>
												</span>
		</p>
	</div>
	</div>

	
	
<div class="recommend-item-box type_blog clearfix"  data-report-click='{"mod":"popu_387","dest":"https://blog.csdn.net/u011225629/article/details/102756288","strategy":"BlogCommendHotData","index":"30"}'>
	<div class="content">
		<a href="https://blog.csdn.net/u011225629/article/details/102756288" target="_blank"  rel="noopener" title="单点登录（SSO）">
		<h4 class="text-truncate oneline">
				单点登录（SSO）		</h4>
		<div class="info-box d-flex align-content-center">
			<p class="date-and-readNum oneline">
				<span class="date hover-show">10-26</span>
				<span class="read-num hover-hide">
					阅读数 
					1万+</span>
				</p>
			</div>
		</a>
		<p class="content">
			<a href="https://blog.csdn.net/u011225629/article/details/102756288" target="_blank" rel="noopener" title="单点登录（SSO）">
				<span class="desc oneline">一、SSO（单点登录）介绍

SSO英文全称Single SignOn，单点登录。SSO是在多个应用系统中，用户只需要登录一次就可以访问所有相互信任的应用系统。它包括可以将这次主要的登录映射到其他应用...</span>
			</a>
			<span class="blog_title_box oneline no-title">
									<span class="type-show type-show-blog type-show-after">博文</span>
												</span>
		</p>
	</div>
	</div>

	
	
<div class="recommend-item-box type_blog clearfix"  data-report-click='{"mod":"popu_387","dest":"https://blog.csdn.net/m0_37907797/article/details/102759257","strategy":"BlogCommendHotData","index":"31"}'>
	<div class="content">
		<a href="https://blog.csdn.net/m0_37907797/article/details/102759257" target="_blank"  rel="noopener" title="漫话：什么是 https ?这应该是全网把 https 讲的最好的一篇文章了">
		<h4 class="text-truncate oneline">
				漫话：什么是 https ?这应该是全网把 https 讲的最好的一篇文章了		</h4>
		<div class="info-box d-flex align-content-center">
			<p class="date-and-readNum oneline">
				<span class="date hover-show">10-26</span>
				<span class="read-num hover-hide">
					阅读数 
					2万+</span>
				</p>
			</div>
		</a>
		<p class="content">
			<a href="https://blog.csdn.net/m0_37907797/article/details/102759257" target="_blank" rel="noopener" title="漫话：什么是 https ?这应该是全网把 https 讲的最好的一篇文章了">
				<span class="desc oneline">今天这篇文章，讲通过对话的形式，让你由浅入深着知道，为什么 Https 是安全的。




一、对称加密

一禅：在每次发送真实数据之前，服务器先生成一把密钥，然后先把密钥传输给客户端。之后服务器给客...</span>
			</a>
			<span class="blog_title_box oneline no-title">
									<span class="type-show type-show-blog type-show-after">博文</span>
												</span>
		</p>
	</div>
	</div>

	
	
<div class="recommend-item-box type_blog clearfix"  data-report-click='{"mod":"popu_387","dest":"https://blog.csdn.net/weixin_45108087/article/details/102766281","strategy":"BlogCommendHotData","index":"32"}'>
	<div class="content">
		<a href="https://blog.csdn.net/weixin_45108087/article/details/102766281" target="_blank"  rel="noopener" title="史上最全的mysql基础教程">
		<h4 class="text-truncate oneline">
				史上最全的mysql基础教程		</h4>
		<div class="info-box d-flex align-content-center">
			<p class="date-and-readNum oneline">
				<span class="date hover-show">10-28</span>
				<span class="read-num hover-hide">
					阅读数 
					1万+</span>
				</p>
			</div>
		</a>
		<p class="content">
			<a href="https://blog.csdn.net/weixin_45108087/article/details/102766281" target="_blank" rel="noopener" title="史上最全的mysql基础教程">
				<span class="desc oneline">启动与停止

启动mysql服务
sudo /usr/local/mysql/support-files/mysql.server start
停止mysql服务
sudo /usr/loc...</span>
			</a>
			<span class="blog_title_box oneline no-title">
									<span class="type-show type-show-blog type-show-after">博文</span>
												</span>
		</p>
	</div>
	</div>

	
	
<div class="recommend-item-box type_blog clearfix"  data-report-click='{"mod":"popu_387","dest":"https://blog.csdn.net/m0_37907797/article/details/102767860","strategy":"BlogCommendHotData","index":"33"}'>
	<div class="content">
		<a href="https://blog.csdn.net/m0_37907797/article/details/102767860" target="_blank"  rel="noopener" title="为什么你学不会递归？告别递归，谈谈我的经验">
		<h4 class="text-truncate oneline">
				为什么你学不会递归？告别递归，谈谈我的经验		</h4>
		<div class="info-box d-flex align-content-center">
			<p class="date-and-readNum oneline">
				<span class="date hover-show">10-28</span>
				<span class="read-num hover-hide">
					阅读数 
					2万+</span>
				</p>
			</div>
		</a>
		<p class="content">
			<a href="https://blog.csdn.net/m0_37907797/article/details/102767860" target="_blank" rel="noopener" title="为什么你学不会递归？告别递归，谈谈我的经验">
				<span class="desc oneline">可能很多人在大一的时候，就已经接触了递归了，不过，我敢保证很多人初学者刚开始接触递归的时候，是一脸懵逼的，我当初也是，给我的感觉就是，递归太神奇了！
可能也有一大部分人知道递归，也能看的懂递归，但在实...</span>
			</a>
			<span class="blog_title_box oneline no-title">
									<span class="type-show type-show-blog type-show-after">博文</span>
												</span>
		</p>
	</div>
	</div>

	
	
<div class="recommend-item-box type_blog clearfix"  data-report-click='{"mod":"popu_387","dest":"https://blog.csdn.net/qq_36903042/article/details/102770331","strategy":"BlogCommendHotData","index":"34"}'>
	<div class="content">
		<a href="https://blog.csdn.net/qq_36903042/article/details/102770331" target="_blank"  rel="noopener" title="大学四年，分享看过的优质书籍">
		<h4 class="text-truncate oneline">
				大学四年，分享看过的优质书籍		</h4>
		<div class="info-box d-flex align-content-center">
			<p class="date-and-readNum oneline">
				<span class="date hover-show">10-27</span>
				<span class="read-num hover-hide">
					阅读数 
					2万+</span>
				</p>
			</div>
		</a>
		<p class="content">
			<a href="https://blog.csdn.net/qq_36903042/article/details/102770331" target="_blank" rel="noopener" title="大学四年，分享看过的优质书籍">
				<span class="desc oneline">数据结构与算法是我在大学里第一次接触到的，当时学了很多其他安卓、网页之类的，一开始就感觉纳闷，数据结构和算法学这个有啥用，再加上上的是一所野鸡大学，老师讲的也是模模糊糊，平时做项目、练习也几乎不用数据...</span>
			</a>
			<span class="blog_title_box oneline no-title">
									<span class="type-show type-show-blog type-show-after">博文</span>
												</span>
		</p>
	</div>
	</div>

	
	
<div class="recommend-item-box type_blog clearfix"  data-report-click='{"mod":"popu_387","dest":"https://blog.csdn.net/harvic880925/article/details/102774769","strategy":"BlogCommendHotData","index":"35"}'>
	<div class="content">
		<a href="https://blog.csdn.net/harvic880925/article/details/102774769" target="_blank"  rel="noopener" title="有哪些让程序员受益终生的建议">
		<h4 class="text-truncate oneline">
				有哪些让程序员受益终生的建议		</h4>
		<div class="info-box d-flex align-content-center">
			<p class="date-and-readNum oneline">
				<span class="date hover-show">10-28</span>
				<span class="read-num hover-hide">
					阅读数 
					2万+</span>
				</p>
			</div>
		</a>
		<p class="content">
			<a href="https://blog.csdn.net/harvic880925/article/details/102774769" target="_blank" rel="noopener" title="有哪些让程序员受益终生的建议">
				<span class="desc oneline">从业五年多，辗转两个大厂，出过书，创过业，从技术小白成长为基层管理，联合几个业内大牛回答下这个问题，希望能帮到大家，记得帮我点赞哦。

敲黑板！！！读了这篇文章，你将知道如何才能进大厂，如何实现财务自...</span>
			</a>
			<span class="blog_title_box oneline no-title">
									<span class="type-show type-show-blog type-show-after">博文</span>
												</span>
		</p>
	</div>
	</div>

	
	
<div class="recommend-item-box type_blog clearfix"  data-report-click='{"mod":"popu_387","dest":"https://blog.csdn.net/hollis_chuang/article/details/102776191","strategy":"BlogCommendHotData","index":"36"}'>
	<div class="content">
		<a href="https://blog.csdn.net/hollis_chuang/article/details/102776191" target="_blank"  rel="noopener" title="最近程序员频繁被抓，如何避免面向监狱编程！？">
		<h4 class="text-truncate oneline">
				最近程序员频繁被抓，如何避免面向监狱编程！？		</h4>
		<div class="info-box d-flex align-content-center">
			<p class="date-and-readNum oneline">
				<span class="date hover-show">10-28</span>
				<span class="read-num hover-hide">
					阅读数 
					5万+</span>
				</p>
			</div>
		</a>
		<p class="content">
			<a href="https://blog.csdn.net/hollis_chuang/article/details/102776191" target="_blank" rel="noopener" title="最近程序员频繁被抓，如何避免面向监狱编程！？">
				<span class="desc oneline">最近，有关程序员因为参与某些项目开发导致被起诉，甚至被判刑的事件发生的比较多：
某程序员因为接了个外包，帮别人写了个软件，结果这个软件被用于赌博导致被抓。
某公司利用爬虫抓取用户信息，最后被发现，导致...</span>
			</a>
			<span class="blog_title_box oneline no-title">
									<span class="type-show type-show-blog type-show-after">博文</span>
												</span>
		</p>
	</div>
	</div>

	
	
<div class="recommend-item-box type_blog clearfix"  data-report-click='{"mod":"popu_387","dest":"https://blog.csdn.net/petterp/article/details/102779131","strategy":"BlogCommendHotData","index":"37"}'>
	<div class="content">
		<a href="https://blog.csdn.net/petterp/article/details/102779131" target="_blank"  rel="noopener" title="一文搞懂什么是TCP/IP协议">
		<h4 class="text-truncate oneline">
				一文搞懂什么是TCP/IP协议		</h4>
		<div class="info-box d-flex align-content-center">
			<p class="date-and-readNum oneline">
				<span class="date hover-show">10-28</span>
				<span class="read-num hover-hide">
					阅读数 
					1万+</span>
				</p>
			</div>
		</a>
		<p class="content">
			<a href="https://blog.csdn.net/petterp/article/details/102779131" target="_blank" rel="noopener" title="一文搞懂什么是TCP/IP协议">
				<span class="desc oneline">什么是TCP/IP协议?

计算机与网络设备之间如果要相互通信,双方就必须基于相同的方法.比如如何探测到通信目标.由哪一边先发起通信,使用哪种语言进行通信,怎样结束通信等规则都需要事先确定.不同的硬件...</span>
			</a>
			<span class="blog_title_box oneline no-title">
									<span class="type-show type-show-blog type-show-after">博文</span>
												</span>
		</p>
	</div>
	</div>

	
	
<div class="recommend-item-box type_blog clearfix"  data-report-click='{"mod":"popu_387","dest":"https://blog.csdn.net/m0_37907797/article/details/102781027","strategy":"BlogCommendHotData","index":"38"}'>
	<div class="content">
		<a href="https://blog.csdn.net/m0_37907797/article/details/102781027" target="_blank"  rel="noopener" title="大学四年自学走来，这些私藏的实用工具/学习网站我贡献出来了">
		<h4 class="text-truncate oneline">
				大学四年自学走来，这些私藏的实用工具/学习网站我贡献出来了		</h4>
		<div class="info-box d-flex align-content-center">
			<p class="date-and-readNum oneline">
				<span class="date hover-show">10-28</span>
				<span class="read-num hover-hide">
					阅读数 
					10万+</span>
				</p>
			</div>
		</a>
		<p class="content">
			<a href="https://blog.csdn.net/m0_37907797/article/details/102781027" target="_blank" rel="noopener" title="大学四年自学走来，这些私藏的实用工具/学习网站我贡献出来了">
				<span class="desc oneline">大学四年，看课本是不可能一直看课本的了，对于学习，特别是自学，善于搜索网上的一些资源来辅助，还是非常有必要的，下面我就把这几年私藏的各种资源，网站贡献出来给你们。主要有：电子书搜索、实用工具、在线视频...</span>
			</a>
			<span class="blog_title_box oneline no-title">
									<span class="type-show type-show-blog type-show-after">博文</span>
												</span>
		</p>
	</div>
	</div>

	
	
<div class="recommend-item-box type_blog clearfix"  data-report-click='{"mod":"popu_387","dest":"https://blog.csdn.net/qing_gee/article/details/102781522","strategy":"BlogCommendHotData","index":"39"}'>
	<div class="content">
		<a href="https://blog.csdn.net/qing_gee/article/details/102781522" target="_blank"  rel="noopener" title="学习 Java 应该关注哪些网站？">
		<h4 class="text-truncate oneline">
				学习 Java 应该关注哪些网站？		</h4>
		<div class="info-box d-flex align-content-center">
			<p class="date-and-readNum oneline">
				<span class="date hover-show">10-28</span>
				<span class="read-num hover-hide">
					阅读数 
					1万+</span>
				</p>
			</div>
		</a>
		<p class="content">
			<a href="https://blog.csdn.net/qing_gee/article/details/102781522" target="_blank" rel="noopener" title="学习 Java 应该关注哪些网站？">
				<span class="desc oneline">经常有一些读者问我：“二哥，学习 Java 应该关注哪些网站？”，我之前的态度一直是上知乎、上搜索引擎搜一下不就知道了。但读者对我这个态度很不满意，他们说，“我在问你，又不是问知乎，问搜索引擎。”你还...</span>
			</a>
			<span class="blog_title_box oneline no-title">
									<span class="type-show type-show-blog type-show-after">博文</span>
												</span>
		</p>
	</div>
	</div>

	
	
<div class="recommend-item-box type_blog clearfix"  data-report-click='{"mod":"popu_387","dest":"https://blog.csdn.net/qing_gee/article/details/102784577","strategy":"BlogCommendHotData","index":"40"}'>
	<div class="content">
		<a href="https://blog.csdn.net/qing_gee/article/details/102784577" target="_blank"  rel="noopener" title="哪些 Java 知识不需要再学了">
		<h4 class="text-truncate oneline">
				哪些 Java 知识不需要再学了		</h4>
		<div class="info-box d-flex align-content-center">
			<p class="date-and-readNum oneline">
				<span class="date hover-show">10-28</span>
				<span class="read-num hover-hide">
					阅读数 
					1万+</span>
				</p>
			</div>
		</a>
		<p class="content">
			<a href="https://blog.csdn.net/qing_gee/article/details/102784577" target="_blank" rel="noopener" title="哪些 Java 知识不需要再学了">
				<span class="desc oneline">张无忌在学太极拳的时候，他爹的师父张三丰告诫他一定要把之前所学习的武功全部忘掉，忘得越多就会学得越快。
同样的，自学 Java 的时候一定要先知道哪些 Java 知识不需要再学了，毕竟技术的更新迭代就...</span>
			</a>
			<span class="blog_title_box oneline no-title">
									<span class="type-show type-show-blog type-show-after">博文</span>
												</span>
		</p>
	</div>
	</div>

	
	
<div class="recommend-item-box type_blog clearfix"  data-report-click='{"mod":"popu_387","dest":"https://blog.csdn.net/qq_36903042/article/details/102792114","strategy":"BlogCommendHotData","index":"41"}'>
	<div class="content">
		<a href="https://blog.csdn.net/qq_36903042/article/details/102792114" target="_blank"  rel="noopener" title="大学四年，我把私藏的自学「学习网站/实用工具」都贡献出来了">
		<h4 class="text-truncate oneline">
				大学四年，我把私藏的自学「学习网站/实用工具」都贡献出来了		</h4>
		<div class="info-box d-flex align-content-center">
			<p class="date-and-readNum oneline">
				<span class="date hover-show">10-29</span>
				<span class="read-num hover-hide">
					阅读数 
					4万+</span>
				</p>
			</div>
		</a>
		<p class="content">
			<a href="https://blog.csdn.net/qq_36903042/article/details/102792114" target="_blank" rel="noopener" title="大学四年，我把私藏的自学「学习网站/实用工具」都贡献出来了">
				<span class="desc oneline">在分享之前，先说说初学者如何学习编程，这个话题想必非常的重要，要学好编程，给你一些学习网站也好、实用工具也好，但前提是你知道如何去学习它。
见过很多初学者，以及小鹿我刚开始学习的时候，也是自己瞎摸索，...</span>
			</a>
			<span class="blog_title_box oneline no-title">
									<span class="type-show type-show-blog type-show-after">博文</span>
												</span>
		</p>
	</div>
	</div>

	
	
<div class="recommend-item-box type_blog clearfix"  data-report-click='{"mod":"popu_387","dest":"https://blog.csdn.net/yangwohenmai1/article/details/102794305","strategy":"BlogCommendHotData","index":"42"}'>
	<div class="content">
		<a href="https://blog.csdn.net/yangwohenmai1/article/details/102794305" target="_blank"  rel="noopener" title="开题——我的第一个网站(1)">
		<h4 class="text-truncate oneline">
				开题——我的第一个网站(1)		</h4>
		<div class="info-box d-flex align-content-center">
			<p class="date-and-readNum oneline">
				<span class="date hover-show">11-12</span>
				<span class="read-num hover-hide">
					阅读数 
					2664</span>
				</p>
			</div>
		</a>
		<p class="content">
			<a href="https://blog.csdn.net/yangwohenmai1/article/details/102794305" target="_blank" rel="noopener" title="开题——我的第一个网站(1)">
				<span class="desc oneline">每个程序员大概都有一个拥有属于自己网站的梦想，我就是这样。

梦想中属于自己的网站是一个有各种功能的大杂烩：

可以当做自己的随笔记事本；

可以在网页上查看自己感兴趣的内容；

不知道吃什么的时候可...</span>
			</a>
			<span class="blog_title_box oneline no-title">
									<span class="type-show type-show-blog type-show-after">博文</span>
												</span>
		</p>
	</div>
	</div>

	
	
<div class="recommend-item-box type_blog clearfix"  data-report-click='{"mod":"popu_387","dest":"https://blog.csdn.net/gao_chun/article/details/102795414","strategy":"BlogCommendHotData","index":"43"}'>
	<div class="content">
		<a href="https://blog.csdn.net/gao_chun/article/details/102795414" target="_blank"  rel="noopener" title="中国麻将：世界上最早的区块链项目">
		<h4 class="text-truncate oneline">
				中国麻将：世界上最早的区块链项目		</h4>
		<div class="info-box d-flex align-content-center">
			<p class="date-and-readNum oneline">
				<span class="date hover-show">10-29</span>
				<span class="read-num hover-hide">
					阅读数 
					3万+</span>
				</p>
			</div>
		</a>
		<p class="content">
			<a href="https://blog.csdn.net/gao_chun/article/details/102795414" target="_blank" rel="noopener" title="中国麻将：世界上最早的区块链项目">
				<span class="desc oneline">中国麻将：世界上最早的区块链项目

最近区块链这个玩意又被市场搞的很是火热，相信大部分人都不太清楚这玩意到底是怎么样的一个概念，它来了，它来了，它到底是啥~ 国家都开始发文支持了，下面是一个通俗易懂的...</span>
			</a>
			<span class="blog_title_box oneline no-title">
									<span class="type-show type-show-blog type-show-after">博文</span>
												</span>
		</p>
	</div>
	</div>

	
	
<div class="recommend-item-box type_blog clearfix"  data-report-click='{"mod":"popu_387","dest":"https://blog.csdn.net/zcg_741454897/article/details/102796022","strategy":"BlogCommendHotData","index":"44"}'>
	<div class="content">
		<a href="https://blog.csdn.net/zcg_741454897/article/details/102796022" target="_blank"  rel="noopener" title="比特币原理详解">
		<h4 class="text-truncate oneline">
				比特币原理详解		</h4>
		<div class="info-box d-flex align-content-center">
			<p class="date-and-readNum oneline">
				<span class="date hover-show">10-29</span>
				<span class="read-num hover-hide">
					阅读数 
					1万+</span>
				</p>
			</div>
		</a>
		<p class="content">
			<a href="https://blog.csdn.net/zcg_741454897/article/details/102796022" target="_blank" rel="noopener" title="比特币原理详解">
				<span class="desc oneline">一、什么是比特币

比特币是一种电子货币，是一种基于密码学的货币，在2008年11月1日由中本聪发表比特币白皮书，文中提出了一种去中心化的电子记账系统，我们平时的电子现金是银行来记账，因为银行的背后是...</span>
			</a>
			<span class="blog_title_box oneline no-title">
									<span class="type-show type-show-blog type-show-after">博文</span>
												</span>
		</p>
	</div>
	</div>

	
	
<div class="recommend-item-box type_blog clearfix"  data-report-click='{"mod":"popu_387","dest":"https://blog.csdn.net/csdnnews/article/details/102815095","strategy":"BlogCommendHotData","index":"45"}'>
	<div class="content">
		<a href="https://blog.csdn.net/csdnnews/article/details/102815095" target="_blank"  rel="noopener" title="L 型程序员，要火！">
		<h4 class="text-truncate oneline">
				L 型程序员，要火！		</h4>
		<div class="info-box d-flex align-content-center">
			<p class="date-and-readNum oneline">
				<span class="date hover-show">10-29</span>
				<span class="read-num hover-hide">
					阅读数 
					8725</span>
				</p>
			</div>
		</a>
		<p class="content">
			<a href="https://blog.csdn.net/csdnnews/article/details/102815095" target="_blank" rel="noopener" title="L 型程序员，要火！">
				<span class="desc oneline">作者 | 胡巍巍出品 | CSDN（ID：CSDNnews）试问人间职业谁最迷？敲代码的程序员算一个。既要被当作修电脑的，还要被当作做网站的；既要被当作杀毒的，还要被当作......</span>
			</a>
			<span class="blog_title_box oneline no-title">
									<span class="type-show type-show-blog type-show-after">博文</span>
												</span>
		</p>
	</div>
	</div>

	
	
                    <div class="recommend-item-box type_hot_word">
                                        <div class="content clearfix">
                        <div class="float-left">
                                                <span>
                            <a href="https://www.csdn.net/gather_19/NtjaMgwsLWRvd25sb2Fk.html" target="_blank">
                            c#俄罗斯方块源码</a>
                        </span>
                                                <span>
                            <a href="https://www.csdn.net/gather_1b/NtjaMgxsLWRvd25sb2Fk.html" target="_blank">
                            c# linq原理</a>
                        </span>
                                                <span>
                            <a href="https://www.csdn.net/gather_1a/NtjaMgysLWRvd25sb2Fk.html" target="_blank">
                            c# 装箱有什么用</a>
                        </span>
                                                <span>
                            <a href="https://www.csdn.net/gather_12/NtjaMgzsLWRvd25sb2Fk.html" target="_blank">
                            c#集合 复制</a>
                        </span>
                                                <span>
                            <a href="https://www.csdn.net/gather_16/NtjaMg0sLWRvd25sb2Fk.html" target="_blank">
                            c# 一个字符串分组</a>
                        </span>
                                                <span>
                            <a href="https://www.csdn.net/gather_26/NtjaMg1sLWJsb2cO0O0O.html" target="_blank">
                            c++和c#哪个就业率高</a>
                        </span>
                                                <span>
                            <a href="https://www.csdn.net/gather_1c/NtjaMg2sLWRvd25sb2Fk.html" target="_blank">
                            c# 批量动态创建控件</a>
                        </span>
                                                <span>
                            <a href="https://www.csdn.net/gather_1a/NtjaMg3sLWRvd25sb2Fk.html" target="_blank">
                            c# 模块和程序集的区别</a>
                        </span>
                                                <span>
                            <a href="https://www.csdn.net/gather_14/NtjaMg4sLWRvd25sb2Fk.html" target="_blank">
                            c# gmap 截图</a>
                        </span>
                                                <span>
                            <a href="https://www.csdn.net/gather_14/NtjaQgwsLWRvd25sb2Fk.html" target="_blank">
                            c# 验证码图片生成类</a>
                        </span>
                                                </div>
                    </div>
                                        </div>
                                    <div class="recommend-loading-box">
                    <img src='https://csdnimg.cn/release/phoenix/images/feedLoading.gif'>
                </div>
                <div class="recommend-end-box">
                    <p class="text-center">没有更多推荐了，<a href="https://blog.csdn.net/" class="c-blue c-blue-hover c-blue-focus">返回首页</a></p>
                </div>
            </div>
                            <div class="template-box">
                    <span>©️2019 CSDN</span><span class="point"></span>
                <span>皮肤主题: 大白</span>
                <span> 设计师:
                                            CSDN官方博客                                    </span>
                </div>
                    </main>
        <aside class="blog_container_aside">
	<!--主页引入-->
            <div id="asideProfile" class="aside-box">
    <!-- <h3 class="aside-title">个人资料</h3> -->
    <div class="profile-intro d-flex">
        <div class="avatar-box d-flex justify-content-center flex-column">
            <a href="https://blog.csdn.net/weixin_41084236">
                <img src="https://profile.csdnimg.cn/1/F/3/3_weixin_41084236" class="avatar_pic" username='weixin_41084236'>
                                    <img src="https://g.csdnimg.cn/static/user-reg-year/1x/2.png" class="user-years">
                            </a>
            
        </div>
        <div class="user-info d-flex flex-column profile-intro-name-box">
            <div>
                                <span class="name csdn-tracking-statistics tracking-click "  style="display:block" data-report-click='{"mod":"popu_379"}' username='weixin_41084236'>
                    <a href="https://blog.csdn.net/weixin_41084236" class="" id="uid" title='超级大黄狗Shawn'>
                        超级大黄狗Shawn                    </a>
                </span>
                            </div>
            <div class="profile-intro-name-boxFooter">
                                    <div class="personal-home-page" style='right:-96px;'><a target="_blank" href="https://me.csdn.net/weixin_41084236">TA的个人主页 ></a></div>
                                <div class="profile-intro-name-boxOpration">
                                            <div class='profile-personal-letter'>
                            <a id="profile-personal-alink" class='profile-personal-alink' href=https://im.csdn.net/im/main.html?userName=weixin_41084236 target="_blank" rel="noopener">私信</a>
                        </div>
                        <div class="opt-box d-flex  flex-column">
                            <span class="csdn-tracking-statistics tracking-click" data-report-click='{"mod":"popu_379"}'>
                                                                    <a class="btn btn-sm btn-red-hollow attention" id="btnAttent" style='padding:0;'>关注</a>
                                                            </span>
                        </div>
                                    </div>
            </div>
        </div>
    </div>
    <div class="data-info d-flex item-tiling">
                <dl class="text-center" title="33">
                            <dt><a href="https://blog.csdn.net/weixin_41084236?t=1">原创</a></dt>
                <dd><a href="https://blog.csdn.net/weixin_41084236?t=1"><span class="count">33</span></a></dd>
                    </dl>
        <dl class="text-center" id="fanBox" title="422">
            <dt>粉丝</dt>
            <dd><span class="count" id="fan">422</span></dd>
        </dl>
        <dl class="text-center" title="258">
            <dt>获赞</dt>
            <dd><span class="count">258</span></dd>
        </dl>
        <dl class="text-center" title="46">
            <dt>评论</dt>
            <dd><span class="count">46</span></dd>
        </dl>
        <dl class="text-center" title="134367">
            <dt>访问</dt>
            <dd><span class="count">13万+</span></dd>
        </dl>
    </div>
    <div class="grade-box clearfix">
        <dl class="aside-box-footerClassify">
            <dt>等级:</dt>
            <dd>
                <a href="https://blog.csdn.net/home/help.html#level" title="4级,点击查看等级说明" target="_blank">
                    <svg class="icon icon-level" aria-hidden="true">
                        <use xlink:href="#csdnc-bloglevel-4"></use>
                    </svg>
                </a>
            </dd>
        </dl>
        <dl>
            <dt>周排名:</dt>
            <dd>
                <a class="grade-box-rankA" href="https://blog.csdn.net/rank/writing_rank" target="_blank">
                    4万+                </a>
            </dd>
        </dl>
        <dl>
            <dt>积分:</dt>
            <dd title="1213">
                1213            </dd>
        </dl>
        <dl title="49214">
            <dt>总排名:</dt>
            <dd>
                <a class="grade-box-rankA" href="https://blog.csdn.net/rank/writing_rank_total" target="_blank">
                    4万+                </a>
            </dd>
        </dl>
    </div>
    <div class="aside-box-footer">
                    <div class="badge-box d-flex">
                <div class="profile-medal">勋章:</div>
                <div class="badge d-flex">
                                                                                                        <div class="icon-badge" title="持之以恒">
                                    <div class="mouse-box">
                                        <img src="https://g.csdnimg.cn/static/user-medal/chizhiyiheng.png" alt="">
                                        <div class="icon-arrow"></div>
                                    </div>
                                    <div class="grade-detail-box">
                                        <div class="pos-box">
                                            <div class="left-box d-flex justify-content-center align-items-center flex-column">
                                                <img src="https://g.csdnimg.cn/static/user-medal/chizhiyiheng.png" alt="">
                                                <p>持之以恒</p>
                                            </div>
                                            <div class="right-box">
                                                授予每个自然月内发布4篇或4篇以上原创或翻译IT博文的用户。不积跬步无以至千里，不积小流无以成江海，程序人生的精彩需要坚持不懈地积累！                                            </div>
                                        </div>
                                    </div>
                                </div>
                                                                                        </div>
                <script>
                    (function($) {
                        setTimeout(function() {
                            $('div.icon-badge.show-moment').removeClass('show-moment');
                        }, 5000);
                    })(window.jQuery)
                </script>
            </div>
                
    </div>
</div>
<script>
    function watchBtnChange(flag, username) {
        $('span.blog-expert-button-follow').each(function(index) {
            if (flag) {
                if ($(this).attr("data-name") == username) {
                    $(this).html('<span class="hover-hide">已关注</span><span class="hover-show">取消</span>').removeClass('btn-red-follow').addClass('btn-gray-follow attented');
                }
            } else {
                if ($(this).attr("data-name") == username) {
                    $(this).html("关注").addClass('btn-red-follow').removeClass('btn-gray-follow attented');
                }
            }
        })
        if (username == $('p.csdn-tracking-statistics').attr("username")) {
            if (flag) {
                $('#btnAttent').addClass("attented").text("已关注").removeClass('btn-red-hollow').addClass('btn-gray-hollow');
                changeFans(1)
            } else {
                $('#btnAttent').text("关注").addClass('btn-red-hollow').removeClass('btn-gray-hollow attented');
                changeFans(-1)
            }
        }


    }

    function changeFans(num) {
        if ($('#fan').text().indexOf('+') < 0) {
            $('#fan').text(parseInt($('#fan').text()) + num);
        } else {
            $('#fanBox').attr('title', parseInt($('#fanBox').attr('title')) + num);
        }
    }
    window.csdn = window.csdn ? window.csdn : {};
    window.csdn.watchBtnChange = watchBtnChange;
</script><div class="csdn-tracking-statistics mb8 box-shadow" data-pid="blog" data-report-click='{"mod":"popu_4"}' data-report-view='{"mod":"popu_4"}' style="height:250px;">
    <div class="aside-content text-center" id="cpro_u2734133">
      <div id="kp_box_56" data-pid="56"><script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- 博客内页左上视窗-20181120 -->
<ins class="adsbygoogle"
     style="display:inline-block;width:300px;height:250px"
     data-ad-client="ca-pub-1076724771190722"
     data-ad-slot="7700527946"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script><img class="pre-img-lasy" data-src="https://kunyu.csdn.net/1.png?p=56&a=703&c=0&k=&d=1&t=3&u=091af3c67b6545d98776f8d8002564f2"></div>    </div>
</div>
<div id="asideNewArticle" class="aside-box">
    <h3 class="aside-title">最新文章</h3>
    <div class="aside-content">
        <ul class="inf_list clearfix csdn-tracking-statistics tracking-click" data-mod="popu_382">
                        <li class="clearfix">
                <a href="https://blog.csdn.net/weixin_41084236/article/details/84578756" target="_blank" >
                                        工资条: Main部分部分                </a>
            </li>
                        <li class="clearfix">
                <a href="https://blog.csdn.net/weixin_41084236/article/details/84562273" target="_blank" >
                                        工资条: EmailSender部分                </a>
            </li>
                        <li class="clearfix">
                <a href="https://blog.csdn.net/weixin_41084236/article/details/84539281" target="_blank" >
                                        工资条: OneEmailInfo部分                </a>
            </li>
                        <li class="clearfix">
                <a href="https://blog.csdn.net/weixin_41084236/article/details/84375236" target="_blank" >
                                        工资条: ReadXLSX部分                </a>
            </li>
                        <li class="clearfix">
                <a href="https://blog.csdn.net/weixin_41084236/article/details/84336293" target="_blank" >
                                        工资条: TableMaker部分                </a>
            </li>
                    </ul>
    </div>
</div>
    <div id="asideCategory" class="aside-box"
         style="display:block!important;">
    <h3 class="aside-title">分类专栏</h3>
    <div class="aside-content">
        <ul>
                            <li class="">
                    <a class="clearfix"
                       href="https://blog.csdn.net/weixin_41084236/article/category/7821299">
                                                    <img src="https://img-blog.csdnimg.cn/20190918140037908.png" alt="">
                                                <span class="title oneline">LeetCode</span>
                                                    <span class="count float-right">7篇</span>
                                            </a>
                </li>
                            <li class="">
                    <a class="clearfix"
                       href="https://blog.csdn.net/weixin_41084236/article/category/8231181">
                                                    <img src="https://img-blog.csdnimg.cn/20190918140158853.png" alt="">
                                                <span class="title oneline">bodymovin</span>
                                                    <span class="count float-right">1篇</span>
                                            </a>
                </li>
                            <li class="">
                    <a class="clearfix"
                       href="https://blog.csdn.net/weixin_41084236/article/category/8251358">
                                                    <img src="https://img-blog.csdnimg.cn/2019091813595558.png" alt="">
                                                <span class="title oneline">Kotlin</span>
                                                    <span class="count float-right">1篇</span>
                                            </a>
                </li>
                            <li class="">
                    <a class="clearfix"
                       href="https://blog.csdn.net/weixin_41084236/article/category/8260295">
                                                    <img src="https://img-blog.csdnimg.cn/20190927151026427.png" alt="">
                                                <span class="title oneline">Android</span>
                                                    <span class="count float-right">1篇</span>
                                            </a>
                </li>
                    </ul>
    </div>
    </div>
<div id="asideArchive" class="aside-box">
    <h3 class="aside-title">归档</h3>
    <div class="aside-content">
        <ul class="archive-list">
                        <!--归档统计-->
            <li>
                <a href="https://blog.csdn.net/weixin_41084236/article/month/2018/11">
                    2018年11月                    <span class="count float-right">6篇</span>
                </a>
            </li>
                        <!--归档统计-->
            <li>
                <a href="https://blog.csdn.net/weixin_41084236/article/month/2018/10">
                    2018年10月                    <span class="count float-right">4篇</span>
                </a>
            </li>
                        <!--归档统计-->
            <li>
                <a href="https://blog.csdn.net/weixin_41084236/article/month/2018/09">
                    2018年9月                    <span class="count float-right">4篇</span>
                </a>
            </li>
                        <!--归档统计-->
            <li>
                <a href="https://blog.csdn.net/weixin_41084236/article/month/2018/08">
                    2018年8月                    <span class="count float-right">13篇</span>
                </a>
            </li>
                        <!--归档统计-->
            <li>
                <a href="https://blog.csdn.net/weixin_41084236/article/month/2018/07">
                    2018年7月                    <span class="count float-right">6篇</span>
                </a>
            </li>
                    </ul>
    </div>
    </div>
<div id="asideHotArticle" class="aside-box">
	<h3 class="aside-title">热门文章</h3>
	<div class="aside-content">
		<ul class="hotArticle-list csdn-tracking-statistics tracking-click" data-report-view='{"mod":"popu_521"}'>
							<li>

					<a href="https://blog.csdn.net/weixin_41084236/article/details/81564963" >
                                                快速入门（完整）：Python实例100个（基于最新Python3.7版本）                    </a>
					<p class="read">阅读数 <span>81944</span></p>
				</li>
							<li>

					<a href="https://blog.csdn.net/weixin_41084236/article/details/82769925" >
                                                Python中的与或非以及逻辑短路                    </a>
					<p class="read">阅读数 <span>11136</span></p>
				</li>
							<li>

					<a href="https://blog.csdn.net/weixin_41084236/article/details/82218431" >
                                                海龟绘图:Python3.7的turtle模块                    </a>
					<p class="read">阅读数 <span>9042</span></p>
				</li>
							<li>

					<a href="https://blog.csdn.net/weixin_41084236/article/details/81457949" >
                                                随机数：Python3.7的random模块详解                    </a>
					<p class="read">阅读数 <span>4259</span></p>
				</li>
							<li>

					<a href="https://blog.csdn.net/weixin_41084236/article/details/84325652" >
                                                工资条邮件分发 : 读取excel并单独用email发送                    </a>
					<p class="read">阅读数 <span>3024</span></p>
				</li>
					</ul>
	</div>
</div>
<div id="asideNewComments" class="aside-box">
    <h3 class="aside-title">最新评论</h3>
    <div class="aside-content">
        <ul class="newcomment-list">
                        <li>
                <a class="title text-truncate" target="_blank" href="https://blog.csdn.net/weixin_41084236/article/details/81564963#comments">快速入门（完整）：Python实例...</a>
                <p class="comment ellipsis">
                    <a href="https://my.csdn.net/weixin_43905657" class="user-name" target="_blank">weixin_43905657：</a>第十一题，代码有问题，你这个是计算从第4个月往后每个月都少计算一对兔子。 应该第一个月兔子等于[code=python]

[month_1, month_2, month_3, month_elder =month_2 +month_elder + month_3, month_1, month_2, month_elder+month_3
/code]                </p>
            </li>
                        <li>
                <a class="title text-truncate" target="_blank" href="https://blog.csdn.net/weixin_41084236/article/details/81564963#comments">快速入门（完整）：Python实例...</a>
                <p class="comment ellipsis">
                    <a href="https://my.csdn.net/weixin_43601532" class="user-name" target="_blank">weixin_43601532：</a>学习下，感谢分享<img src="https://g.csdnimg.cn/static/face/monkey/5.gif" >                </p>
            </li>
                        <li>
                <a class="title text-truncate" target="_blank" href="https://blog.csdn.net/weixin_41084236/article/details/82218431#comments">海龟绘图:Python3.7的tu...</a>
                <p class="comment ellipsis">
                    <a href="https://my.csdn.net/biocobra" class="user-name" target="_blank">biocobra：</a>好文章，收藏了。                </p>
            </li>
                        <li>
                <a class="title text-truncate" target="_blank" href="https://blog.csdn.net/weixin_41084236/article/details/82689315#comments">打字练习:Learn Python...</a>
                <p class="comment ellipsis">
                    <a href="https://my.csdn.net/weixin_43928796" class="user-name" target="_blank">weixin_43928796：</a>没有积分                </p>
            </li>
                        <li>
                <a class="title text-truncate" target="_blank" href="https://blog.csdn.net/weixin_41084236/article/details/81564963#comments">快速入门（完整）：Python实例...</a>
                <p class="comment ellipsis">
                    <a href="https://my.csdn.net/Mryuc" class="user-name" target="_blank">Mryuc：</a>题目很好，但很多答案有错。                </p>
            </li>
                    </ul>
    </div>
</div>
    	<div id="asideFooter">
			
		<div class="aside-box">
			<div id="kp_box_57" data-pid="57"><script type="text/javascript">
    (function() {
        var s = "_" + Math.random().toString(36).slice(2);
        document.write('<div style="" id="' + s + '"></div>');
        (window.slotbydup = window.slotbydup || []).push({
            id: "u3163270",
            container:  s
        });
    })();
</script>
<!-- 多条广告如下脚本只需引入一次 -->
<script type="text/javascript" src="//cpro.baidustatic.com/cpro/ui/c.js" async="async" defer="defer" ></script><img class="pre-img-lasy" data-src="https://kunyu.csdn.net/1.png?p=57&a=77&c=0&k=&d=1&t=3&u=7c89c7fcc7b9400f9cbc83a81cfd00ab"></div>		</div>
				<div class="aside-box">
			<div class="persion_article">
			</div>
		</div>
	</div>
</aside>
<script src="https://csdnimg.cn/pubfooter/js/publib_footer-1.0.3.js" data-isfootertrack="false" type="text/javascript"></script>
<script>
	$("a.flexible-btn").click(function(){
		$(this).parents('div.aside-box').removeClass('flexible-box');
		$(this).remove();
	})
</script>
<script src="https://g.csdnimg.cn/user-tooltip/1.9/user-tooltip.js"  type="text/javascript"></script>
    </div>
                </div>

<div class="mask-dark"></div>
<div class="tool-box vertical">
    	<ul class="meau-list">
		<li class="btn-like-box long-width">
			<button class=" long-height hover-box btn-like " title="点赞">
				<svg class="icon active hover-hide" aria-hidden="true">
					<use xlink:href="#csdnc-thumbsup-ok"></use>
				</svg>
				<svg class="icon no-active hover-hide" aria-hidden="true">
					<use xlink:href="#csdnc-thumbsup"></use>
				</svg>
				<span class="hover-show text-box text">
					<span class="no-active">点赞</span>
					<span class="active">取消点赞</span>
				</span>
				<p id="supportCount">236</p>
			</button>
		</li>
		<li class="to-commentBox" id = 'sharePost' data-report-click='{"mod":"popu_794","dest":"https://blog.csdn.net/weixin_41084236/article/details/81564963"}'>
			<a class="btn-comments low-height hover-box" >
				<svg class="icon hover-hide" aria-hidden="true">
					<use xlink:href="#csdnc-share"></use>
				</svg>
				<span class="hover-show text">海报</span>
				<p class="">
				</p>
			</a>
			<a href="https://blogdev.blog.csdn.net/article/details/99646245" target="view_window">
				<div class = 'shareSuggest' id = 'shareSuggest'>
					分享海报说明
					<svg class="shareIcon" aria-hidden="true">
						<use xlink:href="#csdnc-help"></use>
					</svg>
					<div class = 'shareTriangle'></div>
				</div>
			</a>
		</li>
		<li class="to-commentBox">
						<a class="btn-comments long-height hover-box" title="写评论" href="#commentBox">
				<svg class="icon hover-hide" aria-hidden="true">
					<use xlink:href="#csdnc-comments"></use>
				</svg>
				<span class="hover-show text">评论</span>
				<p class="">
						29				</p>
			</a>
		</li>
		<li class="toc-container-box" id="liTocBox">
			<a class="btn-toc low-height hover-box btn-comments" title="目录">
				<svg class="icon hover-hide" aria-hidden="true">
					<use xlink:href="#csdnc-contents"></use>
				</svg>
				<span class="hover-show text">目录</span>
			</a>
			<div class="toc-container">
				<div class="pos-box">
					<div class="icon-arrow"></div>
					<div class="scroll-box">
						<div class="toc-box"></div>
					</div>
				</div>
				<div class="opt-box">
					<button class="btn-opt prev nomore" title="向上">
						<svg class="icon" aria-hidden="true">
							<use xlink:href="#csdnc-chevronup"></use>
						</svg>
					</button>
					<button class="btn-opt next">
						<svg class="icon" aria-hidden="true">
							<use xlink:href="#csdnc-chevrondown"></use>
						</svg>
					</button>
				</div>
			</div>

		</li>
		<li>
			<a class="btn-bookmark low-height hover-box btn-comments" title="收藏">
				<svg class="icon active hover-hide" aria-hidden="true">
					<use xlink:href="#csdnc-bookmark-ok"></use>
				</svg>
				<svg class="icon no-active hover-hide" aria-hidden="true">
					<use xlink:href="#csdnc-bookmark"></use>
				</svg>
					<span class="hover-show text">收藏</span>
				<!-- <span class="hover-show text-box text">
					<span class="no-active">收藏</span>
					<span class="active">取消收藏</span>
				</span> -->
			</a>
		</li>
		<li class="bdsharebuttonbox">
			<div class="weixin-qr btn-comments low-height hover-box" >
				<a id="btnQrShare" class="bds_weixin clear-share-style" title="手机看"></a>
				<svg class="icon hover-hide" aria-hidden="true">
					<use xlink:href="#csdnc-usephone"></use>
				</svg>
				<span class="hover-show text text3">
					手机看
				</span>
			</div>
		</li>
							<li class="widescreen-hide">
				<a class="prev btn-comments low-height hover-box" href="https://blog.csdn.net/weixin_41084236/article/details/81509339" title="备胎模块：Python3.7的operator模块">
					<svg class="icon hover-hide" aria-hidden="true">
						<use xlink:href="#csdnc-chevronleft"></use>
					</svg>
					<span class="hover-show text text3">上一篇</span>
				</a>
			</li>
								<li class="widescreen-hide">
			<a class="next btn-comments hover-box low-height" href="https://blog.csdn.net/weixin_41084236/article/details/81626968" title="花式迭代器：Python3.7的itertools模块">
				<svg class="icon hover-hide" aria-hidden="true">
					<use xlink:href="#csdnc-chevronright"></use>
				</svg>
				<span class="hover-show text text3">下一篇</span>
			</a>
		</li>
						<!-- 宽屏更多按钮 -->
		<li class="widescreen-more">
			<a class="btn-comments chat-ask-button low-height hover-box" title="快问" href="#chatqa">
				<svg class="icon hover-hide" aria-hidden="true">
					<use xlink:href="#csdnc-more"></use>
				</svg>
				<span class="hover-show text">更多</span>
				
			</a>
			<ul class="widescreen-more-box">
													<li class="widescreen-more">
						<a class="btn-comments low-height hover-box" href="https://blog.csdn.net/weixin_41084236/article/details/81509339" title="备胎模块：Python3.7的operator模块">
							<svg class="icon hover-hide" aria-hidden="true">
								<use xlink:href="#csdnc-chevronleft"></use>
							</svg>
							<span class="hover-show text text3">上一篇</span>
						</a>
					</li>
																<li class="widescreen-more">
					<a class="btn-comments hover-box low-height" href="https://blog.csdn.net/weixin_41084236/article/details/81626968" title="花式迭代器：Python3.7的itertools模块">
						<svg class="icon hover-hide" aria-hidden="true">
							<use xlink:href="#csdnc-chevronright"></use>
						</svg>
						<span class="hover-show text text3">下一篇</span>
					</a>
				</li>
							</ul>
		</li>
        		<li class="to-commentBox to-reward">
			<a class="btn-comments low-height hover-box" title="打赏">
				<svg class="hover-hide" width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
					<g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
						<g transform="translate(-1398.000000, -486.000000)" fill-rule="nonzero">
							<g transform="translate(1398.000000, 486.000000)">
								<path d="M0,12 C0,16.287187 2.287187,20.2487113 6,22.3923048 C9.7128129,24.5358984 14.2871871,24.5358984 18,22.3923048 C21.712813,20.2487113 24,16.287187 24,12 C24,5.37258296 18.627417,0 12,0 C5.372583,0 0,5.37258296 0,12 Z" id="路径" fill-opacity="0.3" fill="#FF5A52"></path>
								<path d="M2.09340659,11.9505494 C2.09340659,15.4721673 3.97216734,18.7262766 7.02197798,20.4870856 C10.0717886,22.2478946 13.8293103,22.2478946 16.8791209,20.4870856 C19.9289316,18.7262766 21.8076923,15.4721673 21.8076923,11.9505494 C21.8076923,6.50659974 17.3944991,2.09340659 11.9505495,2.09340659 C6.50659977,2.09340659 2.09340659,6.50659974 2.09340659,11.9505494 Z" id="路径" fill="#F63D47"></path>
								<path d="M11.3005025,5.28638434 L12.7115578,5.28638434 L12.7115578,6.87854416 L14.1105528,6.87854416 C14.4,6.39607148 14.6592965,5.89550609 14.8884422,5.37081705 L16.1849246,5.82313519 C15.99799,6.23926787 15.7929648,6.58906055 15.5758794,6.88457507 L18,6.88457507 L18,9.84575109 L16.6733668,9.84575109 L16.6733668,8.03647857 L7.33869347,8.03647857 L7.33869347,9.85781291 L6,9.85781291 L6,6.87854416 L8.51457286,6.87854416 C8.31557789,6.52875147 8.08040201,6.1910206 7.80904523,5.86535155 L9.08140703,5.4009716 C9.39497488,5.80504246 9.67236181,6.29957695 9.92562814,6.88457507 L11.3065327,6.88457507 L11.3065327,5.28638434 L11.3005025,5.28638434 Z M12.8571429,13.9657994 C12.6552823,15.5675992 12.2332101,16.6234672 11.5848095,17.1394027 C10.8813559,17.8053195 9.1991844,18.2312662 6.54441188,18.4292415 L6,17.2233922 C8.22046642,17.1394027 9.68854339,16.8454395 10.3919969,16.3415024 C11.0098127,15.8735609 11.3768319,15.0456644 11.4930547,13.8578129 L12.8571429,13.9657994 Z M16.8571429,12.1435272 L16.8571429,15.9892245 L15.5161905,15.9892245 L15.5161905,13.3067319 L9.05523809,13.3067319 L9.05523809,16.1435272 L7.71428571,16.1435272 L7.71428571,12.1435272 L16.8571429,12.1435272 L16.8571429,12.1435272 Z M8.28571429,8.71495577 L15.7142857,8.71495577 L15.7142857,11.5720986 L8.28571429,11.5720986 L8.28571429,8.71495577 L8.28571429,8.71495577 Z M14.5714286,10.4292415 L14.5714286,9.28638434 L10,9.28638434 L10,10.4292415 L14.5714286,10.4292415 Z M12.9579832,16.1435272 C14.8187275,16.4853162 16.4993998,16.9018717 18,17.3931934 L17.2436975,18.4292415 C15.635054,17.8311106 13.9783914,17.3664911 12.2857143,17.0407235 L12.9579832,16.1435272 L12.9579832,16.1435272 Z" id="形状" fill="#FFFFFF"></path>
							</g>
						</g>
					</g>
				</svg>
				<span class="hover-show text">打赏</span>
			</a>
							<div id="reward" class="reward-box">
	<p class="rewad-title">打赏<span class="reward-close"><svg t="1567152543821" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="10924" xmlns:xlink="http://www.w3.org/1999/xlink" width="12" height="12"><defs><style type="text/css"></style></defs><path d="M512 438.378667L806.506667 143.893333a52.032 52.032 0 1 1 73.6 73.621334L585.621333 512l294.485334 294.485333a52.074667 52.074667 0 0 1-73.6 73.642667L512 585.621333 217.514667 880.128a52.053333 52.053333 0 1 1-73.621334-73.642667L438.378667 512 143.893333 217.514667a52.053333 52.053333 0 1 1 73.621334-73.621334L512 438.378667z" fill="" p-id="10925"></path></svg></span></p>
	<dl>
		<dd><a href="javascript:;"><img src="https://profile.csdnimg.cn/1/F/3/3_weixin_41084236" alt=""></a></dd>
		<dt>
			<p class="blog-name">超级大黄狗Shawn</p>
			<p class="blog-discript">“你的鼓励将是我创作的最大动力”</p>
		</dt>
	</dl>
	<div class="money-box">
        			            	<span class="choosed choose_money" data-id="5">5C币</span>
			        							<span class="choose_money" data-id="10">10C币</span>
			        							<span class="choose_money" data-id="20">20C币</span>
			        							<span class="choose_money" data-id="50">50C币</span>
			        							<span class="choose_money" data-id="100">100C币</span>
			        							<span class="choose_money" data-id="200">200C币</span>
			        	</div>
	<div class="sure-box">
		<p class="is-have-money"><a class="reward-sure">确定</a></p>
	</div>
</div>

					</li>
        		<!--脉脉曝光外链-->
		<li>
			<a class="btn-maimai low-height hover-box btn-comments" title="脉脉" target="_blank" href="https://i.csdn.net/#/account/bind?utm_source=blogMaiMai">
				<svg class="hover-hide" width="24px" height="24px" viewBox="0 0 22 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
				<g  stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
					<g  transform="translate(-1355.000000, -433.000000)" fill-rule="nonzero">
						<g transform="translate(1355.000000, 433.000000)">
							<g >
								<path d="M11.9728475,0.371685864 L20.8834689,5.3746178 C21.5061808,5.72305759 21.8941017,6.38663874 21.8957175,7.10663874 L21.8957175,17.0074555 C21.8941017,17.7259476 21.5061808,18.3892775 20.8834689,18.7379686 L11.9728475,23.7405236 C11.3721356,24.0771518 10.6401695,24.0771518 10.0387119,23.7405236 L1.12858757,18.7379686 C0.504757062,18.3891518 0.11820339,17.725822 0.116587571,17.0074555 L0.116587571,7.10663874 C0.118451977,6.38663874 0.504757062,5.72305759 1.12858757,5.3746178 L10.0388362,0.371685864 C10.6401695,0.0341780105 11.371887,0.0341780105 11.9728475,0.371685864 L11.9728475,0.371685864 Z" id="路径" fill="#3FD9FF"></path>
								<path d="M11.1045311,1.93470157 C11.0426328,1.90102618 10.968678,1.90102618 10.9070282,1.93470157 L1.99777401,6.9373822 C1.936,6.97055497 1.89846328,7.03514136 1.8980904,7.10663874 L1.8980904,17.0074555 C1.8980904,17.0750576 1.936,17.1410262 1.99777401,17.1760838 L10.9070282,22.1777592 C10.968678,22.2124398 11.0426328,22.2124398 11.1045311,22.1777592 L20.0137853,17.1760838 C20.0749379,17.1419058 20.1139661,17.077445 20.1139661,17.0074555 L20.1139661,7.10663874 C20.1139661,7.03526702 20.0750621,6.97055497 20.0137853,6.9373822 L11.1045311,1.93470157 Z M11.9728475,0.371685864 L20.8834689,5.3746178 C21.5061808,5.72305759 21.8941017,6.38663874 21.8957175,7.10663874 L21.8957175,17.0074555 C21.8941017,17.7259476 21.5061808,18.3892775 20.8834689,18.7379686 L11.9728475,23.7405236 C11.3721356,24.0771518 10.6401695,24.0771518 10.0387119,23.7405236 L1.12858757,18.7379686 C0.504757062,18.3891518 0.11820339,17.725822 0.116587571,17.0074555 L0.116587571,7.10663874 C0.118451977,6.38663874 0.504757062,5.72305759 1.12858757,5.3746178 L10.0388362,0.371685864 C10.6401695,0.0341780105 11.371887,0.0341780105 11.9728475,0.371685864 L11.9728475,0.371685864 Z" id="形状" fill="#5296DE"></path>
							</g>
							<path d="M11.1045311,1.93470157 C11.0426328,1.90102618 10.968678,1.90102618 10.9070282,1.93470157 L1.99777401,6.9373822 C1.936,6.97055497 1.89846328,7.03514136 1.8980904,7.10663874 L1.8980904,17.0074555 C1.8980904,17.0750576 1.936,17.1410262 1.99777401,17.1760838 L10.9070282,22.1777592 C10.968678,22.2124398 11.0426328,22.2124398 11.1045311,22.1777592 L20.0137853,17.1760838 C20.0749379,17.1419058 20.1139661,17.077445 20.1139661,17.0074555 L20.1139661,7.10663874 C20.1139661,7.03526702 20.0750621,6.97055497 20.0137853,6.9373822 L11.1045311,1.93470157 Z" id="路径" fill="#3D5AB7"></path>
							<g  transform="translate(5.344633, 6.408377)">
								<rect fill="#F8A115" x="5.99692655" y="0.0796649215" width="3.84577401" height="1.0615288"></rect>
								<g fill="#FFFFFF">
									<path d="M2.61439548,0.0796649215 L1.16239548,0.0796649215 L0.374497175,0.0796649215 L0.111864407,0.0796649215 L0.111864407,11.6343455 L1.16214689,11.6343455 L1.16214689,8.10534031 L2.61439548,8.10534031 L2.61439548,11.6343455 L3.66430508,11.6343455 L3.66430508,0.0796649215 L3.30919774,0.0796649215 L2.61439548,0.0796649215 Z M2.61439548,7.04381152 L1.16239548,7.04381152 L1.16239548,4.57658639 L2.61451977,4.57658639 L2.61451977,7.04381152 L2.61439548,7.04381152 Z M1.16239548,3.51468063 L1.16239548,1.14119372 L2.61451977,1.14119372 L2.61451977,3.51480628 L1.16239548,3.51468063 L1.16239548,3.51468063 Z" id="形状"></path>
									<polygon id="路径" points="4.39776271 5.10747644 5.63684746 5.10747644 4.24102825 11.0423874 5.25563842 11.3176963 6.90526554 4.57658639 6.90824859 4.04569634 4.39776271 4.04569634"></polygon>
									<path d="M8.95114124,5.46056545 L11.093096,3.63656545 L10.416565,2.82458639 L8.35975141,4.5754555 L8.35975141,3.10856545 L8.35975141,2.55442932 L8.35975141,2.04703665 L5.16279096,2.04703665 L5.16279096,3.10856545 L7.30971751,3.10856545 L7.30971751,11.6343455 L8.35975141,11.6343455 L8.35975141,6.61118325 L10.7107684,11.1709319 L11.6419774,10.6802513 L8.95114124,5.46056545 Z M8.35987571,5.14517277 L8.35987571,5.11677487 L8.37640678,5.13662827 L8.35987571,5.14517277 Z" id="形状"></path>
								</g>
							</g>
						</g>
					</g>
				</g>
				</svg> 
				<img class="hover-show  maimai-bg" src="https://csdnimg.cn/release/phoenix/static_blog/images/maimai_bg.png?v1">
			</a>
		</li>
	</ul>
</div>
<div id = 'tool-post-common'>
	<div class = 'tool_post_box'>
		<img class = 'tool_post_img' src="https://csdnimg.cn/release/phoenix/write/assets/postShareBack.png" alt="">
		<div id = 'shareCode'></div>
	</div>
</div>
<div id="share-bg-shadow">
<div id="share-qrcode-box">
    <h3>分享到微信朋友圈</h3>
    <div class='qrcode-img-box'>
        <a class="btn-close">×</a>
        <div id='shareQrCode'></div>
	</div>
    <p>扫一扫，手机浏览</p>
</div>
</div>
<script>
		var imgReal = new Image();
		imgReal.src = "https://csdnimg.cn/release/phoenix/write/assets/postShareBack.png"
</script>
<script type=text/javascript crossorigin src="https://csdnimg.cn/release/phoenix/production/qrcode-7c90a92189.min.js"></script>
<script src="//g.csdnimg.cn/??sharewx/1.2.1/sharewx.js" type="text/javascript"></script>
<script src="https://g.csdnimg.cn/collection-box/1.1.2/collection-box.js?t=201908091" type="text/javascript"></script>
<script>
    var recommendCount = 79;
    recommendCount = recommendCount > 1 ? (recommendCount + (recommendCount>6 ? 2 : 1)) : recommendCount;
    var ChannelId = 16;
    var articleId = "81564963";
    var commentscount = 29;
    var islock = false;
    var curentUrl = "https://blog.csdn.net/weixin_41084236/article/details/81564963";
    var myUrl = "https://my.csdn.net/";
    //1禁止评论，2正常
    var commentAuth = 2;
    //百度搜索
    var baiduKey = "快速入门（完整）：Python实例100个（基于最新Python3.7版本） - Shawn的博客";
    var needInsertBaidu = true;
    // 代码段样式
    var codeStyle = 'atom-one-dark';
	var highlight = ["\u5feb\u901f","\u5165\u95e8","\u5b8c\u6574","Python","\u5b9e\u4f8b","\u6700\u65b0","Python","\u7248\u672c"];//高亮数组

    var share_card_url = 'https://blog.csdn.net/weixin_41084236/article/shareArticleCardPage?article_id=81564963'
    var RecommendBlogExpertList = [{"user_name":"Ch97CKd","nick_name":"\u7a81\u56f4\u7684\u9c7c","avatar":"https:\/\/profile.csdnimg.cn\/5\/4\/9\/3_ch97ckd","is_expert":false,"article_count":391,"rank":"7000+"},{"user_name":"qq_41597912","nick_name":"\u71d5\u5927\u4fa0v","avatar":"https:\/\/profile.csdnimg.cn\/A\/C\/D\/3_qq_41597912","is_expert":false,"article_count":156,"rank":"7000+"},{"user_name":"weixin_37998647","nick_name":"\u65e0\u77e5\u7684\u8717\u725b","avatar":"https:\/\/profile.csdnimg.cn\/4\/7\/6\/3_weixin_37998647","is_expert":false,"article_count":76,"rank":"\u5343\u91cc\u4e4b\u5916"},{"user_name":"huaxiawudi","nick_name":"juunnry","avatar":"https:\/\/profile.csdnimg.cn\/F\/8\/D\/3_huaxiawudi","is_expert":false,"article_count":134,"rank":"\u5343\u91cc\u4e4b\u5916"},{"user_name":"qq_35527032","nick_name":"\u50b2\u51b3\u6d41\u4e91","avatar":"https:\/\/profile.csdnimg.cn\/D\/E\/2\/3_qq_35527032","is_expert":false,"article_count":28,"rank":"\u5343\u91cc\u4e4b\u5916"},{"user_name":"fanren224","nick_name":"fanren224","avatar":"https:\/\/profile.csdnimg.cn\/3\/A\/3\/3_fanren224","is_expert":false,"article_count":451,"rank":"6000+"},{"user_name":"u014044812","nick_name":"\u732a\u54e566","avatar":"https:\/\/profile.csdnimg.cn\/1\/2\/F\/3_u014044812","is_expert":true,"article_count":140,"rank":"1000+"},{"user_name":"x851288986","nick_name":"coder\u5c0f\u660e","avatar":"https:\/\/profile.csdnimg.cn\/3\/4\/0\/3_x851288986","is_expert":false,"article_count":77,"rank":"\u5343\u91cc\u4e4b\u5916"},{"user_name":"easylife206","nick_name":"\u8fd0\u7ef4\u4e4b\u7f8e","avatar":"https:\/\/profile.csdnimg.cn\/3\/6\/C\/3_easylife206","is_expert":false,"article_count":133,"rank":"\u5343\u91cc\u4e4b\u5916"},{"user_name":"kexuanxiu1163","nick_name":"\u7a0b\u5e8f\u5458\u5434\u5e08\u5144","avatar":"https:\/\/profile.csdnimg.cn\/8\/0\/2\/3_kexuanxiu1163","is_expert":false,"article_count":404,"rank":"5000+"}];
	var articleType = 1;
	var CopyrightContent = '';
</script>
<script src="https://csdnimg.cn/public/sandalstrap/1.4/js/sandalstrap.min.js"></script>
<script src="https://csdnimg.cn/release/phoenix/vendor/pagination/paging-3d3b805766.js"></script>
<div class="skin-boxshadow"></div>
<div style="display:none;">
	<img src="" onerror='setTimeout(function(){if(!/(csdn.net|iteye.com|baiducontent.com|googleusercontent.com|360webcache.com|sogoucdn.com|bingj.com|baidu.com)$/.test(window.location.hostname)){window.location.href="\x68\x74\x74\x70\x73\x3a\x2f\x2f\x77\x77\x77\x2e\x63\x73\x64\x6e\x2e\x6e\x65\x74"}},3000);'>
</div>
</body>
<script type="text/javascript" src="https://csdnimg.cn/release/phoenix/production/pc_wap_common-f91259fb12.js" /></script>
<link rel="stylesheet" href="https://csdnimg.cn/release/blog_editor_html/release1.5.9/ckeditor/plugins/codesnippet/lib/highlight/styles/atom-one-dark.css">
<script>
 // 全局声明
 if (window.csdn === undefined) {
      window.csdn = {};
    }
    window.csdn.sideToolbar = {
        options: {
            report:{
                isShow: true,
            },
            qr: {
                isShow: false,
            }
        }
    }
    $(function(){
        $(document).on('click',"a.option-box[data-type='report']",function() {
            showReport(false,articleTitles)
        });
    })
</script>
<script src="https://csdnimg.cn/release/phoenix/vendor/iconfont/csdnc-c439e66521.js"></script>
<script src="https://csdnimg.cn/release/phoenix/template/js/common-d90c3ecc7d.min.js"></script>
<script src="https://csdnimg.cn/release/phoenix/template/js/detail-ffbab56068.min.js"></script>
	<script src="https://csdnimg.cn/release/phoenix/themes/skin3-template/skin3-template-e2b6be7b58.min.js"></script>
<script src="//g.csdnimg.cn/??login-box/1.0.7/login-box.js,login-box/1.0.7/login-auto.js,copyright/1.0.3/copyright.js" type="text/javascript"></script>
<script>
    $(".MathJax").remove();
    if ($('div.markdown_views pre.prettyprint code.hljs').length > 0) {
        $('div.markdown_views')[0].className = 'markdown_views';
    }
    var persentSet = 1;
</script>
<script type="text/javascript" src="https://csdnimg.cn/release/blog_mathjax/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<script type="text/x-mathjax-config">
    MathJax.Hub.Config({
            "HTML-CSS": {
                    linebreaks: { automatic: true, width: "94%container" },
                    imageFont: null
            },
            tex2jax: {
                preview: "none"
            },
            mml2jax: {
                preview: 'none'
            }
    });
</script>
    <script src="//g.csdnimg.cn/baidu-search/1.0.2/baidu-search.js"  type="text/javascript"></script>
</html>
